Trying to get a copy of GRBL to run on a Nano clone with a 3drive shield.
Have an Uno running correctly and have used AVRDude to copy the flash image to a file.
Nano will compile and program, but nothing comes out of the serial port.
Have tried direct USB connection and RX/TX to FT1232 board.
Have confirmed that the Nano will output serial both ways as well.
Nano bootloader has been set as an Uno, otherwise the image is too big to fit.
Both are using the 328P MCU.
Serial chip on nano is a CH340, but that should really only matter to the PC I'm connecting it to.
Nano works for everything else, just not this.
Also tried to copy the Uno hex file directly into the Nano using AVRDude.
After the hex copy, dumped the Nano flash back to separate file and compared.
Found differences.
Why?
Working Uno flash file has data in the 0x7800-0x7AC0 range while the Nano dump has all FF's in this range.
This section is the only piece that is different.
What is it? Why would it prevent the Nano from talking on the serial?
Why didn't it copy over from the Uno hex file?
Arduino IDE will not take the GRBL code if the device is set as a Nano - with either of the bootloaders.
Google search said something about old ROM code that they didn't want to fix, and just burn as an Uno.
I think you misunderstood what you were being told here. On the other hand it cold just be rubbish. Can you post the link to where you got that from please.
@david_2018
Reasonably sure I did.
Set up 4 of these and did a bootload burn on all 4.
Pretty sure I set it as Uno... I suppose I can always got back and do it again just to be sure.
Still doesn't explain why the HEX write was different. Made sure to have AVRDude erase first and it still has that separate section.
@Grumpy_Mike
I know this.. and you know this.
Arduino IDE does not know this.
Go download the GRBL code and see for yourself.
It compiles to 31346 bytes, which is 97% of the Uno memory.
If you try to burn that while set as a Nano, it says 102% and will not write.
@Grumpy_Mike
You put the entire GRBL directory in the Arduino library directory.
Open the INO file in the grbl/examples and compile/upload.
I promise you, it is a valid sketch and it all works properly.
and that if you have the IDE set for NANO, it will not upload. But if you have it set for Uno, it will.
That is because the upload.maximum_size for the Nano is set to 30720 but for the Uno it is 32265.
You can modify the boards.txt file and change it to 32265 for the Nano, then it should work.
FYI: The regular bootloader for the Uno and Nano are the same.
I have grbl running on two nanos although ISTR that they both are from a batch than needs the "old bootloader" selected in the IDE.
I do not recall having to do anything special to get them to work.
Or do as @chaos0711, and many others, have done and burn the bootloader to the Nano with the board selection set to UNO. Just have to remember to always select UNO as the board type when compiling for that Nano.