I have created a design with an STM32L07xxx and an ATtiny that communicate with each other through UART.

Unfortunately I forgot to include a pulldown resistor to the BOOT0 pin of the STM. The result is that the STM mostly starts in bootloader mode. A redesign nor rework are an option at the moment.

My initial strategy was to use the ATtiny to make use of the bootloader commands to jump to the application code with help of the 'Go' command (as described in AN3155)

Unfortunately the binary I've been provided with enables RDP level 1 which stops me from using 'Go'. (I've tried, it only responds with nACKs)

My final option seems to be to set read protection to level 2 to ensure the bootloader jumps to either bank1 or bank2 (AN2606 42.1.2)

My question is; How do I ensure that the bootsequence jumps to bank1?

Other alternative suggestions that result in the application code being executed are also welcome!


When RDP level 2 is set, it boots from bank 2 only if

  • The BFB2 option bit is set. When it is not, then the bootloader is not started at all, it jumps straight to flash bank 1, therefore the stuff in AN2606 does not apply at all.
  • and the very first word of bank 2 is a valid stack pointer, i.e. it points to a valid address in the internal SRAM. Otherwise it goes to bank 1.

If one of the above is false, then you are lucky :)

See section 3.3.2 in the Reference Manual for details.

enter image description here

  • \$\begingroup\$ Unfortunately the firmware does not seem to fully execute, I suspect it checks to see if the RDP is equal to level 1 as opposed to equal or bigger then RDP level 2 and locks down. I will still mark your answer as accepted as it does seem to result in BANK1 being executed. Thank you for your answer! \$\endgroup\$ – Joshua de Haan Oct 12 '17 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.