#avr Logs

Jul 10 2019

#avr Calendar

12:34 AM gsi__ is now known as gsi_
01:37 AM day__ is now known as day
03:43 PM cehteh: WTF i have some weird bug where the firmware crashes and runs havoc, and hardware reset doesnt 'cure' it, comes back in the same weird state, needs power cycle
03:44 PM cehteh: watchdog disabled, but loos like something enables the watchdog
03:46 PM timemage: cehteh, you don't have the fuse for it on, right?
03:51 PM cehteh: no, i dont pet the watchdog i dont enable it
03:51 PM cehteh: and a powercyle fixed it
03:52 PM cehteh: what else besides the watchdog survives a resewt?
03:52 PM cehteh: (+ srem, but the clib should clear it
03:53 PM cehteh: ultra strange
03:53 PM cehteh: no bootloader, directly flashed fw
03:56 PM cehteh: certainly bug in my code, but i have no clue what causes this
03:56 PM cehteh: happehnd on 2 mcus on 2 different locations :P
04:32 PM timemage: cehteh, not a lot in terms of registers. the content of the stack and heap would be whatever they used to be. so if you'd had a unitialized local or dynamic allocation it could take values influnced from the previous run.
04:40 PM cehteh: heap gets initialized by the clib prior main is entered
04:42 PM cehteh: stack i should check, but normally the compiler wouls already detect uninitialized local vars
04:44 PM cehteh: mhm race on missing volatile perhaps?
04:47 PM timemage: cehteh, your made your down start code?
04:47 PM cehteh: no
04:51 PM timemage: https://pastebin.com/HYJNeLje if it were doing anything to clear the heap i'd kind of expect to see it there.
05:04 PM cehteh: whats your c surce?
05:05 PM timemage: cehteh, it's right there in the command-line.
05:06 PM cehteh: ah it clears /initializes only bss .. variables
05:06 PM timemage: cehteh, right, not the heap.
05:07 PM cehteh: i dont use heap
05:07 PM timemage: cehteh, well, i was being exhaustive =)
05:07 PM cehteh: only static/global vars and stack
05:07 PM timemage: cehteh, yes, again. trying to list everything that comes to mind that can survive the reset.
05:08 PM timemage: cehteh, data left on the stack. data left on the heap. it's also possible to apply a section attribute to get data out of the bss/initdata area.
05:08 PM cehteh: long time on my todo list is a stack checker, will add that next
05:09 PM cehteh: yes i dont use noinit sections
05:09 PM cehteh: i know that
05:09 PM timemage: cehteh, well, we're running out of things then =)
05:09 PM cehteh: yes that make me wtf
05:10 PM cehteh: accidentaly enabling the wdc is rather impossible
05:10 PM timemage: cehteh, are you running from battery?
05:11 PM cehteh: best bet would be uninitialized local var, gcc didnt detect (can haopprn) or race because of missing volatile
05:12 PM cehteh: no battery
05:13 PM cehteh: and this error happend no 2 tine in a row, one machine in copenhagen one breadboard her at my offive ..otherwise it ran for weeks w/o hitch
05:13 PM cehteh: rather rare race condition ..fun
05:21 PM timemage: cehteh, having maybe reading from an array with an index calculating out of bounds. so you'd have the compile not detecting it through static analysis and it sensitive to prior run state. if it's not huge i'd look at it. otherwise not sure what more to say.
05:21 PM cehteh: yes will check that