#avr Logs

Jun 09 2020

#avr Calendar

04:06 PM m4t: hi, i've got an atmega48p board i did some surgery on and replaced with an atmega328p. the original chip had SPI disabled so i couldn't reprogram it. i put a bootloader on the chip, but after power on, it does *not* enter the bootloader.
04:12 PM m4t: i have either reset it with avrdude+buspirate over ISP. or touch the reset pin to pull it to ground. from that point on it boot loops (led in optiboot blinking, 8s timeout, repeat).
04:12 PM cehteh: did you configure the bootloader properly?
04:12 PM m4t: i mean, i think so...
04:12 PM cehteh: iirc optiboot has some options, only entering the bootloader when some pin or reset was triggered etc
04:12 PM m4t: make atmega328 TIMEOUT=8 AVR_FREQ=8000000L BAUD_RATE=57600 LED=B0 LED_START_FLASHES=127
04:12 PM m4t: yeah. there must be some option im missing...i didn't see a relevant make option. perhaps it's a #define not exporter via makefile?
04:12 PM cehteh: maybe you have to rtfm
04:12 PM cehteh: optiboot is optimized for size, not features its sometimes a bit ugly :D
04:12 PM m4t: please read it for me
04:12 PM m4t: it's not here https://github.com/Optiboot/optiboot/wiki/CompilingOptiboot
04:12 PM m4t: and yeah, it is quite ugly btw :)
04:12 PM m4t: i guess small is not necessarily beautiful
04:16 PM m4t: i guess i'd need to edit this to change the behavior. https://github.com/Optiboot/optiboot/blob/master/optiboot/bootloaders/optiboot/optiboot.c#L601-L604
04:20 PM m4t: that might not work though - i think it might just reset after the timeout rather than jumping to application code.
04:24 PM cehteh: look into the headers .. i think i remmeber there is some config option somwhere
04:27 PM cehteh: https://github.com/Optiboot/optiboot/blob/master/optiboot/bootloaders/optiboot/optiboot_x.c#L363
04:27 PM m4t: i thought that was just for newer post-microchip chips
04:28 PM m4t: i guess the same could be done in optiboot.c ?
04:28 PM cehteh: i havent looked closely, thats your job
04:32 PM cehteh: do you really want it go into bootloader mode even at powerup?
04:32 PM m4t: i dont think so
04:32 PM m4t: im looking into tapping dtr on the cp210x
04:32 PM cehteh: well i dont know what you want then
04:33 PM m4t: i just wanted to be able to enter the bootloader at all
04:33 PM m4t: and i can with a highly manual process of grounding the reset pin with a jumper wire
04:33 PM cehteh: would be fine by me :D
04:34 PM cehteh: well the usual way is to pull reset down with a cap over dtr
04:34 PM cehteh: i often remvoe that cap
04:35 PM cehteh: check out arduino nano schematics
04:36 PM m4t: yeah i'm looking at schematics now thanks
04:42 PM cehteh: its a bit of a hack
04:46 PM m4t: i'm not confident that i can tap onto the dtr pin of the cp2102 without kludging it
04:46 PM m4t: i'm going to hold off on that until i get my code working
04:50 PM cehteh: huh whats the problem?
04:51 PM * cehteh looking at https://www.silabs.com/documents/public/data-sheets/cp2104.pdf
04:51 PM cehteh: there are gpio pins (do you use the 2104?)
04:52 PM cehteh: it would be pretty clever when you could program those to initiate the reset instead relying on the dtr/reset hack
04:57 PM m4t: its just a cp2102. it is very small area to solder to. no exposed pads really. not broken out anywhere.
04:57 PM m4t: rts is broken out to a trace that goes nowhere.
11:34 PM day_ is now known as day