cancel
Showing results for 
Search instead for 
Did you mean: 

IRDA protocol used on USART peripheral in boot mode

Mathieu Garivet
Associate III
Posted on October 23, 2016 at 13:53

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-!bootloader
5 REPLIES 5
Posted on October 23, 2016 at 14:45

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Mathieu Garivet
Associate III
Posted on October 23, 2016 at 16:11

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.

Posted on October 23, 2016 at 16:36

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Mathieu Garivet
Associate III
Posted on October 24, 2016 at 16:36

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.

Posted on October 24, 2016 at 19:00

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...

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..