I set up my Arduino and ATtiny45 the way the tutorial How-To: Shrinkify Your Arduino Projects showed. I wish to make an LED, hooked up to my breadboard, blink.
I'm running Windows XP, and I have the latest release of the Arduino IDE and have set up my programmer to be Arduino as ISP, as well as my board to be ATtiny45 (8 MHz internal clock).
The problem occurs when I try and upload the compiled code onto the board. The IDE returns this error:
avrdude: stk500_getsync(): not in sync: resp=0x00
I have searched for answers for a long time, but I found nothing. How do I fix it?
It means that your microcontroller is not detected. Things to check:
Wiring: are the pins used for chip programming correctly connected (no crossing?)
Power supply: Is the board properly powered?
PC configuration: Is the Arduino IDE using the correct port of the PC?
and from the Arduino help:
If you have an Arduino NG, did you press reset just before selecting
Upload menu item?
Is the correct serial port selected?
Is the correct driver installed?
Is the chip inserted into the Arduino properly?
If you built your own Arduino or have burned the bootloader on yourself: Does the chip have the correct bootloader on it?
Arduino is bootloader based. This means that the chip must have a little piece of software inside that is responsible for the communication with the Arduino IDE and the self programming of your application binary into the chip. This piece of software is called "bootloader". If your chip came empty ( sold separately or erased by mistake ), there is no bootloader inside.
There is no way to program a booloader into a chip without using an external programmer.
(Or another bootloader already inside. Some chips include a low level bootloader in the ROM...)
But, luckily for you, building a home made programmer for AtTiny is easy. Search google for "AtTyny ISP programmer".
And if you have questions about that, ask them at "Electrical Engineering StackExchange"
When you get a virgin ATTiny, you need to set the fuse bits on it. It does not require the Arduino bootloader, but the process is similar to burning the bootloader. This tutorial helped me get my ATTiny85 up and running, take note of the "Configuring the ATtiny to run at 8 MHz (for SoftwareSerial support)" section.
Also, I've noticed there are different 'board drivers': the items that appear in 'Tools > Board' in the Arduino IDE. You may be using a set that does not work, try this, this or have a google around to find more. Just be sure to go through the entire process when you try a new set (i.e. burn the bootloader, reboot, burn your code).
Good luck.
In my case i had the same issue with Duemilenove Arduino compatible board i bought
I found this fix.
Go to \hardware\arduino\boards.txt, find this line "uno.name=Arduino Uno uno.upload.protocol=arduino", replace the protocol=arduino to =stk500.
I don't know if it works on Uno, but it did save me from similar issue with Duemilanove.
I've had the same problem with getting attiny85 to work.
In my case, arduino micro was used to program it.
I digged into this problem and found that the recent version of arduino IDE(1.8.5) was slightly wrong with its configuration of utilizing the avrdude.
I'm assuming that you already tried burning bootloader but it fails with STK500 sync error.
How to fix:
Prepare a text editor program which is able to edit unix line ending files properly. eg) Vim, Emacs, Microsoft Visual Studio, notepad+, atom
Go to the arduino install directory. eg) C:\Program Files(x86)\Arduino
Open hardware\arduino\avr\programmers.txt with the editor you prepared. If it's under the program files directory, running text editor as administrator would be useful.
On line 44, you can find Arduino as ISP. Keep following those lines and edit these two lines like below.
arduinoasisp.protocol=arduino
arduinoasisp.program.protocol=arduino
Save and try burning bootloader again.
It must had stk500v1 as default. It basically should be the same but the recent version of avrdude(also included in arduino ide by default) has different workflow on them.
Another useful info: burning bootloader on attiny also does fuse work.
Related
I'm using the same code that is still working for a new version of equipment the company the bought.
I can't communicate with the equipment in vb in visual studio (the language of the last code I wrote). But I can make a simple code in LabVIEW to see if the equipment is communicating and it is.
So, my question is what code is labview sending to the equipment?
The only thing I see from the LabVIEW GUI is *IDN?\n
Is that the same as what I writing?
mySerialport.WriteLine("*idn?" + Chr(10))
*IDN?\n
is not the same as :
mySerialport.WriteLine("*idn?" + Chr(10))
The former is capitalized while the later is not and it may cause an issue depending on the instrument.
You are using the serial port, so the most important thing to consider is the baud rate. It is possible that the later model equipment your company purchased has a different baud rate to the one that was used previously.
If you want to see exactly the data that LabVIEW is sending, you can use NI IO Trace or a non NI serial port monitor such as listed here
The question isn’t what language LabVIEW uses. LabVIEW is a programming environment with library APIs to speak to lots of hardware and the ability for anyone to write code to speak to even more hardware. The question is “what language does the HARDWARE speak?” To answer that, you’d post what kind of hardware it is and probably go to the manufacturer’s website for a spec sheet.
“*IDN?/n” looks like a GPIB command, which is just a framework serial protocol. You’d need the spec sheet of the hardware to know the particular commands that your hardware understands.
PS: LabVIEW doesn’t have a GUI showing anything about hardware communication. You have an application written in LabVIEW that has a GUI that is displaying information. You can edit the program to print out more info if you want, just like you could in VB. Complaining about the “LabVIEW GUI” in this case is equivalent to complaining about the Visual Studio GUI when the problem is with the program you’ve written in VS!
"The only thing I see from the labview GUI is *IDN?/n"
That sounds more like you are using the VISA Test Panel in MAX (Measurement and Automation eXplorer). It is related to LabVIEW in that it is also a tool developed by National Instruments (NI). But it does not sound like you have actually touched LabVIEW itself.
As was already stated, *IDN?\n is a typical command that an instrument that follows the SCPI messaging standard. On a Windows system, that is usually the same as "*idn?" + Chr(13) + Chr(10).
As SeanJ pointed out *IDN?\n is not the same as "idn?". Further, make sure that space character in your calling method is visible. Sometimes machines require you to manually type "\r\n" for complete carriage return.
I'm using STM32Cube to generate simple USB MSC project. I'm using STM32F417VG.
So I'm selecting USB_OTG_FS - Device_only and USB_DEVICE - Class For FS IP - Mass Storage Class.
Then I'm generating source code, compile it and download to board, put it's USB cable to PC and nothing happens.
What am I doing wrong?
The STM32Cube application helps you get started on developing an application, but does not do the work for you. The generated code will include all the libraries necessary and initialize the hardware so that all the functions you selected are available and ready to go, and then begin an empty infinite loop. It will not show any outward behavior or respond to any external stimulus.
You will need to add some of your own code for the microcontroller to actually do anything.
If you are unsure what you need to do to make the USB functions work, take a look at the example projects that come with STM32Cube and the documentation comments in the library files it included in your project.
However, even a "simple" USB project can be relatively complex, and an unresponsive microcontroller can be mystifying. You may want to get your bearings with very simple GPIO-type projects. Making an LED blink is a microcontroller's "Hello World".
I have a basic firmware question. I am looking to program a nRF51822 IC and integrate it on my own PCB. The evaluation kit seems to already have the IC soldered on it. Is it a way I can only program the nRF51822 and getting it ready to use elsewhere?
Get yourself one of these J-LINK LITE CortexM:
and hook up your connection header like this to your microcontroller (SWDIO, SWCLK, VCC and GND are the only ones needed):
.
Then, use Keil or nRFGo Studio to program your device.
You don't need J-Link at all. Any STLinkv2 board will work, like STM32 dev boards. But even nicer are these cheap Chinese programmers: http://www.aliexpress.com/item/FREE-SHIPPING-ST-Link-V2-stlink-mini-STM8STM32-STLINK-simulator-download-programming-With-Cover/32247200104.html
All you need to do is connect the Vcc, Ground, SDIO, and SWDCLK lines from your board/chip to the programmer, so make sure those pins are broken out and easy to get to.
There are some good instructions on how to do that here: https://github.com/RIOT-OS/RIOT/wiki/Board:-yunjia-nrf51822
I've built Linux workstations for workers on assembly lines to use with this method, and it just loops over and over for new boards. So they don't even need to touch the PC, they can just place a board on the jig or connect a header and it's all automatic.
You will need a programming device, such as a Segger Jlink. The eval kit has an on-board Segger programmer on it (that big chip with the Segger sticker on it).
I'm working through this process myself at the moment. I read somewhere that some people were successful at 'hacking' the eval kit, to bring the SWDIO and SWCLK over to their custom board but that really isn't the right way to go about it.
Instead, purchase an actual programmer and put a programming header on your custom circuit board.
While I am also still in the research phase here as well, it looks like there are 4-5 pins to connect from the programmer to your custom target board. The nRF documentation seems to be rather lacking in the definition of the programming setup, but look under the debugging category and take a look at Segger documentation as well.
If going into mass production there are ways to pre-program the chip before assembly, but I haven't had a chance to learn about that just yet.
I am using an Olimex sam7s256 board. I tried to get it up and running in linux (Ubuntu). I was able to successfully install GCC and binutils. I installed SAM-BA for linux from the atmel site. I was able to get the USB port for connection as specified in the SAM-BA manual (.dev/ttyUSB0).
But when I try to use the GUI and 'connect' there is no response.
I though that there is a connection failure, so when I presses the reset button in the board, I get a message "Failed to initialize FLASH accesses".
No matter how long I wait before pressing the reset button, I am not getting any SAM-BA window as given by other tutorials as below
can any one one help me out in this?
I did the 'tst' jumper set, reconnect the board for 10 s, disconnect and 'tst' jumper reset, reconnect before opening SAM-BA.
Any help will be greatly appreciated.
I am stuck.
It is the same for both SAM-BA 2.9 and 2.8.
By this point you are already connected. If you specified the at91sam7256-ek even if you arent using that board it will not put this gui up if it didnt talk to the chip/board. I recently went through this exercise with an olimex sam7s-256 header board. (with ubuntu linux). If I didnt specify the board type then the window came up but it wasnt really connected.
Notice how the code at 0x00200000 is valid instructions (most start with a 0xE and the vector table starts with a bunch of 0xEAs which are branches out of the vector table) that is ram it didnt make those up it read that from somewhere. Load a binary file into ram in the 0x00200000 range and the refresh the memory (assuming your binary is different from what is there) and see it change.
When ready/comfortable you can erase the flash and see in the memory window that the flash (0x0010000 or something like that) changes to all 0xFFFFFFFFs. Now remember it wont boot when you do that. With the board I have there is a jumper you move then power the board to get the built in bootloader re-loaded into the flash so that you can use sam-ba again, I am sure there is a way to do that with your board but read the users guide first.
Please do not close this person out for asking about using a software tool. There are countless numbers of how do I use my iphone simulator or why is my android simulator slower than my iphone simulator questions that dont get touched. this question is as relevant as any of the programming questions about how to use gcc or some web thing or how to start up my phone simulator or java vm. I wouldnt want to have to start a campaign to close all of the gcc or iphone tagged questions because they are not programming questions.
I think my question was misunderstood. The GUI window which I have posted is NOT what I get. I just posted it to say that I am not getting such a window at all. That window pops up only when I select 'no board'. When I select SAM7S256-EK there is no response. No window opens. As given in your blog sam7stuff.blogspot.com, I downloaded SAM-BA. The onlydifference as u have posted and in the response also id that u are using a 'h' board.
Right now I am using a custom made SAMBA alternative from this website,
http://claymore.engineer.gvsu.edu/~steriana/Software/
It is also a python based boot loader. It is command line though.
I would love to use the SAM-BA GUI. I am sure that the board is OK and samba is communicating with the board b'cos if I select any other board type other than ARM7S256-EK option it is giving me 'communication failure'.
If you have any suggestions please do let me know. Also many thanks for backing me up. I had some real good insights from this forum about embedded field and I felt it is a good place to discuss embedded programming doubts and never thought of 'programming' or 'non-programming' b'cos for SAM-BA user guide itself talks a lot about customizing the SAM-BA for a custom made board involving TCL scripts but I couldnot get hold of the concepts. So I thought someone would have had the same problem and would have found a TCL or C 'programming' solutions in this forum.
Thank you.
Can anybody tell me where I can find information related to How to Bringup any arm board? I am looking for an overview as I am novice in ARM related stuffs. Any link/document will do ...It will be gr8 help if i can look for a case-study
any arm based board can be considered..I am looking for just a case study...simple in few steps??
Every single ARM "board" will be different. Read the datasheet for the ARM chip you have, that should have a section near the start about booting. Also, read the datasheet about your board, as it made have flash/boot loaders on there. If there are no loaders on the board, you'll have to either set the jumpers for the ARM (if that type supoprts it) to read from external rom, or JTAG the initial boot code into it.
Basically: Read the datasheets. Programming a device like an ARM isn't your usual compile/run stratergy like most software, especially not in the first stage.
edit:
If you don't even have a board yet, try going for this one:
http://beagleboard.org/
It has and ARM on it (as well as a decent GPU).
Check the DLP-2232PB-G evaluation kit from FTDI. Looks great for newbies trying to get into microcontrollers, and it comes with everything you need. It's a PIC controller - not an ARM controller, but the easiest starting point that I've seen... and same basic methods of development.
I would start with any documentation the IC manufacturer may have on "getting started".
http://free-electrons.com/doc/porting-kernel.odp
This link gives a good overview of the bringup of the board with a CPU for which the linux support package is available.
Linux sources in arch/arm have mach-* which are cpus supported by Linux Kernel.
With in the mach-* dir, there are some board specific files that are board specific BSPs.
You can take the process elucidated in this article and try using in your case.
Check out the ok6410-h at http://www.arm9board.net/sel/prddetail.aspx?id=348&pid=200
Quit a nice kicking-start kit coming with everyting you would ever need: documentations, source code, example programs.
recommendable for both newbies and experienced.