2016-01-27 05:46 AM
Hi,
I am using the microcontroller STM32L0. I configured two pins(PB5 and PB6) of the micro as outputs. And the PB5 is in SET state and the PB6 is in RESET state. To update the firmware , we use the bootloder. To enter in bootlodaer mode, we make a jump to its address. But once the bootloader started, I lost the configuration of my two pins, and my RS232 transceiver cannot be ON. Because to activate the transceiver, I must have PB5 SET and PB6 RESET. Is it normal that the GPIO configuration can be lost in bootloader mode? Thank you2016-02-02 05:49 AM
The example code is for STM32L073Z. I changed some code to make it compatible with my board 'STM32L051'.
I have changed: #define FLASH_START_BANK2 ((uint32_t)0x08007FFF) May be I missed other important changes? I tried to program a little .bin file. It went up until 100% , but I never get the message ''Programming Completed Successfully''.2016-02-02 08:22 AM
Well it is going to be important that the code does not erase flash it is using itself. Check the size of the created code (.MAP)
Also the flash bank isn't likely to be at an odd address like 0x08007FFF, which would be one byte shy of 32KBI'm not a big fan of ST's Y-Modem code, there are perhaps some robustness issue that could cause it to stall. Does dropping the baud rate help? Does debugging tell you anything about where it is stalled?2016-02-02 08:53 AM
Hi clive1,
After debugging, the system is stuck in the function UART_WaitOnFlagTimeout(..)(stm32l0xx_hal_uart.c) , after executingFLASH_If_Erase(APPLICATION_ADDRESS);
*p_size = filesize;
Serial_PutByte(ACK);
Serial_PutByte(CRC16);
in the Ymodem_Receive function(Ymodem.c).
2016-02-03 08:20 AM
After the ''inspection'', the program is not stuck in the uart_waitonFlagtimeout. The characters ACK and CRC 16 are sent. But, i cannot see them with tera term.
Using the realterm, i see more details. The program sends ''CA'' characters after the ACK and CRC 16 of the memory erase. But, there is a strange phenomenon, during the file transfer, there are only two packets received. The first packet includes the file name,size ..and the second packet includes the data. Then the communication is abort, and I receive CA (0x18). When I check the memory, this one is not written with the only received packet of data. There are only zeros in the memory.