Skip to main content
prsh
Associate III
January 2, 2019
Question

bootloader without manual pin settings

  • January 2, 2019
  • 3 replies
  • 2202 views

hello

I am using stm32l4 series microcontroller with keil mdk arm 5 programing.

Had successfully completed the booting process by manually setting boot0 pin and resetting the device using flash loader demo tool. Now i wanted to do the same without manual change of boot0 pin. Is it possible???Is there any tool for purpose??

Thanks​

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
January 2, 2019

Which L4 part?

Something like this would probably work if the code isn't checking the flash

/*
In startup.s
 
Reset_Handler PROC
 EXPORT Reset_Handler [WEAK]
 IMPORT SystemInit
 IMPORT __main
 
 LDR R0, =0x20017FF0 ; Address for RAM signature
 LDR R1, =0xDEADBEEF
 LDR R2, [R0, #0]
 STR R0, [R0, #0] ; Invalidate
 CMP R2, R1
 BEQ Reboot_Loader
 
 LDR R0, =SystemInit
 BLX R0
 LDR R0, =__main
 BX R0
 
 ENDP ; Reset_Handler
 
 
Reboot_Loader PROC
 EXPORT Reboot_Loader
 
 LDR R0, =0x40021060 ; RCC_APB2ENR
 LDR R1, =0x00000001 ; ENABLE SYSCFG CLOCK
 STR R1, [R0, #0]
 LDR R0, =0x40010000 ; SYSCFG_MEMRMP
 LDR R1, =0x00000001 ; MAP ROM AT ZERO
 STR R1, [R0, #0]
 LDR R0, =0x1FFF0000 ; ROM BASE of L4
 LDR SP,[R0, #0] ; SP @ +0
 LDR R0,[R0, #4] ; PC @ +4
 BX R0
 
 ENDP ;sourcer32@gmail.com
 
 
In main.c */
 
//***************************************************************************
 
void BootDFU(void)
{
 puts("Entering Boot Loader..");
 *((unsigned long *)0x20017FF0) = 0xDEADBEEF; // 96KB
 __DSB();
 NVIC_SystemReset(); 
}
 
//***************************************************************************

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
prsh
prshAuthor
Associate III
January 2, 2019

STM32L432KX and bootloader using uart

prsh
prshAuthor
Associate III
January 2, 2019

Also what will be the state of BOOT0 pin??

prsh
prshAuthor
Associate III
January 18, 2019

successfully done bootloading. but issue with the current consumption.

in bootloading mode -->> 0.015-0.016A

in programming mode -->> 0.003 - 0.004A

have given timer after which only my bootloading mode starts but it is sometimes showing correct output as expected (0.004A i.e. initially program is running than after sometime going in boot mode) and sometimes initially going in boot mode (0.016A).

Thanks in advance!