cato, (edited )
@cato@chaos.social avatar

screaming at infineon

they state that a system reset resets all peripherals, as you would reasonably expect

yet when I trigger a system reset by software, my timer period register keeps its value 💀

cato,
@cato@chaos.social avatar

>Timer period shadow register and actual value register both have the value 3746

>Change the shadow register to 0, the debugger confirms

>Initiate the transfer to the actual register, the debugger confirms

>Disable peripheral

>System reset

>Back at the beginning of main()

>Check registers

>Both are 3746 again

why are you like this

lambda,
@lambda@chaosfurs.social avatar

@cato does infineon have errata sheets? Or do they not bother because they'd be longer than the reference manual?

cato,
@cato@chaos.social avatar

I completely forgot that I have my bootloader on this controller and with every system reset, it executes

And I think the bootloader uses the timer too, and while it does stop it before switching to the main code, it does not reset it 🤦‍♂️

cato,
@cato@chaos.social avatar

I knew it was gonna be something dumb but not THIS dumb omg

cato,
@cato@chaos.social avatar

okay so this isn't the full story, I just spent like another hour desperately trying to figure out why my timer refused to generate any interrupts when the code was started via the bootloader

well, you see, I wrote the code I'm woprking on now before I wrote the bootloader. Now that I have the bootloader, I'm coming back to it. I did a little thing in the bootloader before jumping to the application code to ensure nothing would mess up the process.

Can you guess what it was?

salkinium,
@salkinium@chaos.social avatar

@cato Ah, a classic. On some STM32, the system ROM bootloader doesn't set the stack pointer back to what is in your application vector table, so your application has a stack overflow during boot.

WooShell,
@WooShell@chaosfurs.social avatar

@cato This smells incredibly like a "couldn't be bothered to make it right" thing.
"We'll just footnote it in the datasheet, it'll be fine."

cato,
@cato@chaos.social avatar

@WooShell well it isn't footnoted in the datasheet

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • Hentai
  • doujinshi
  • announcements
  • general
  • All magazines