cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F2xx] Usage of SYSCFG_MEMRMP?

root
Associate II
Posted on August 12, 2011 at 12:18

Hello,

I'm trying to figure out the production process of my product and I cannot understand how the SYSCFG_MEMRMP bits work.

Is it possible (and how) to put the boot pins physically (via pu/pd res) to boot the builtin bootloader, use this bootloader to program my own bootloader, and add some code in my own bootloader to disable the built-in bootloader (and additionnaly enter ReadOut Protection, at least level 1) ?

This way we could plug empty boards to USART 1 (I use it for PC communication too in the application), and do the whole programming process without the need for an another programming port.

Thomas.

3 REPLIES 3
Posted on August 12, 2011 at 22:14

On the F1's we just started the System Boot loader by calling it directly from our own loader. The BOOT pins don't need to be tweaked.

The SYSCFG_MEMRMP bits should just alter what is currently mapped/shadowed at ZERO. The ROM/FLASH are usually compiled/linked for their native addresses, and the Cortex-M3 just loads the SP/PC, and proceeds. Then you'd update the vector address the core uses, otherwise it will assume a zero basis.

You can read SYSCFG_MEMRMP to determine how the chip was booted. On the F1's you could do that be looking at the data at zero, and comparing it to RAM/ROM/FLASH content, as the BOOTx pins were not readable.

Using USART1 for programming/debug/telemetry here, generally attached to some terminal software.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
root
Associate II
Posted on August 12, 2011 at 22:32

Hello,

This means I have no way of disabling the builtin bootloader from my code?

You say one can call the builtin bootloader from user code, ok, but that's not what I want 😉

I'd like to setup the board to start the builtin bootloader by default (setting BOOT0/1 with pull up / pull down), to be able to inject my own bootloader, then from my bootloader, disable the builtin bootloader so that I don't need to change anything physically (BOOT0/1 pins still configured to boot system memory).

Then when doing a mass erase (to exit ROP level 1), the board goes back to system memory by default (and I can download a new bootloader or application, whatever ...).

Is this possible or do I absolutely need to physically toggle BOOT0 pin to do this?

Best regards,

Thomas.

root
Associate II
Posted on August 12, 2011 at 22:55

Back,

I've read again all the documentation I found about this, and it seems there is no way to either have the builtin bootlader started when the chip is empty with BOOT0 low, or disable the builtin bootloader when BOOT0 is high.

I guess my best option is a row of ST-Link (using STLink Utility) and a direct physical access to the JTAG port (there is a connector I use for dev that will not be populated in production, but we could use a pogo bed to temporary connect to it).

Thomas.