Go Down

Topic: nrf24l01+ arduino bootloader (optiboot-nrf24l01) (Read 610 times) previous topic - next topic

Fiskusmati

Feb 20, 2019, 06:48 pm Last Edit: Feb 20, 2019, 06:51 pm by Fiskusmati
Hello.
My aim:
I need to upload new sketches to remote device, which can't be easily accessed to its usb or isp port. And it has already  nrf24l01+ onboard.



I'm inspired by this: https://www.youtube.com/watch?v=8xJqVeZkEw8
This guy made it the way I want to.

What I'm trying to set up, is:
-remote station with nrf24l01 (arduino uno + nrf24l01 optiboot bootloader)
-local station with nrf24l01 (stock arduino uno)
upload sketches from PC to local station using USB cable, local station then sends sketch via nrf24, remote station receives sketch via nrf24 (already in bootloader state) and update new sketch.




I use this gits:
https://github.com/nicolas-schurando/optiboot-nrf24l01
https://github.com/nicolas-schurando/optiboot-nrf24l01-flasher

First is bootloader for remote station, second is flasher



I use Linux Ubuntu.



What I do:

for a remote station:
1. generate optiboot_atmega328.hex file (make atmega328 LED_START_FLASHES=0 RADIO_UART=1 FORCE_WATCHDOG=1 SUPPORT_EEPROM=1)
2. change fuses using avrdude (efuse:w:0xFD:m  hfuse:w:0xDA:m  lfuse:w:0xFF:m) (connected via USBASP - to ISP pins)
3. upload optiboot_atmega328.hex file using avrdude and USBASP ISP
4. change lock bits to 0x0F (0F producess an error so I use 0xCF)
5. change first 6 eeprom bytes to 0x30 0x30 0x31 0x30 0x30 0x30
6. connect nRF24l01+ and disconect programmer from ISP pins

for a local station:
1. modify flasher sketch (I simply add eeprom write to set first 6 eeprom bytes 0x30 0x30 0x30 0x30 0x30 0x31)
2. upload flasher sketch nrf24l01 - ino file (using usb cable)
3. put electrolytic capacitor 10uF between reset goldpin and gnd (- side to RST) so local station won't reset anymore
4. select blinky example in arduino and try to send it to local station via usb cable hoping that local station will send everything over the air
5. sometimes i try pressing reset button on remote station to chceck if it is issue but it does not matter

What I'm getting is:
Code: [Select]
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x53



*nrf modules have good 3v3 psu and 10uF, and work both ways (tested on another applicatons)
*remote station is beeing reset by watchdog every 4s and it stays in bootloader for 1s.
*I'm able to upload software to remote station using usb bootloader, so generally optiboot is working




I will appreciate any help.

Thanks, Matt.

Go Up