2016-10-23 04:53 AM
Hi everybody,
(I'm working with a STM32F042) I know that the user application is able to call the internal bootloader (the one in ROM). According to AN2606, the procedure consits in the following steps :Disable all peripheral clocks
Disable used PLL
Disable interrupts
Clear pending interrupts
I do not see any peripheral reconfiguration in doing that. So I'm wondering if it's possible to configure the USART peripheral in IRDA protocol mode, then do all the steps above and finally jump to the internal bootloader ?
I know that USARTx is configured in 8-bits, even parity and 1 Stop bit after the boot mode entry. But since no RESET has been done, is there any chance that the IRDA configuration remains active ? Thanks for your answer ! Best regards, MG. #irda #!stm32-!bootloader2016-10-23 05:45 AM
The system loader assumes it has a blank slate, it reconfigures everything assuming it is in a reset state.
If you want an IrDA loader, you'll need to write one.2016-10-23 07:11 AM
Hi clive1, thank you for your answer. I had a little hope but I must indeed write my own.
Have a nice day. Regards, MG.2016-10-23 07:36 AM
I'm not sure your list from AN2606 is correct.
On the M0 you'd need to ensure the ROM is correctly mapped at zero, and it is not that you disable interrupts, but rather turn off the ones you've turned on. You might want to look at the IAP examples for this and other STM32 parts. You want a half-duplex protocol like X-MODEM where you can pace and control the transfer.2016-10-24 07:36 AM
I used the application note
AN
4065
''STM32F0xx in-application programming using the USART
'' and modified USART configuration to use IRDA. The example from the AN4065 uses YMODEM protocol to send/receive the user application. But aren't the transfert protocols XMODEM, YMODEM a little bit old fashioned ? Everything works fine since this afternoon : I successfully succeeded in sending a new user program via the IAP/bootloader program through the IR link !! :) Since it uses flash space memory, I will try to reduce its size (currently 7ko). Changing transfert protocol could help ? Thanks for your answers ! Regards, MG.2016-10-24 10:00 AM
But aren't the transfer protocols XMODEM, YMODEM a little bit old fashioned ?
Yes, but they are very robust and simple to implement in C or Assembler, and there is support in most Terminal applications.Some of us are a bit old too...