Skip to main content
Graduate
November 29, 2023
Solved

Help for choosing UART pins for bootloader

  • November 29, 2023
  • 3 replies
  • 2548 views

Hello,

I'm designing a pcb with a STM32L031 MCU. I will use serial UART2 for bootload and debug.

In ST application note nº2606 and "STM32L031x4 STM32L031x6 datasheet", it is said :

"The boot loader is located in System memory. It is used to reprogram the Flash memory by
using SPI1 (PA4, PA5, PA6, PA7), USART2 (PA2, PA3) or USART2 (PA9, PA10). See
STM32™ microcontroller system memory boot mode AN2606 for details."

My question is : Is it possible to flash the device with USART2 but with USART2_TX located on PA14 and not PA2 ?

My application context makes it mandatory insofar as PA2 is already used for ADC purpose.

Thank you very much for any help !

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    No. The firmware is in ROM and not flexible to your needs.

    AN2606 defines the pins it can use.

    3 replies

    Graduate II
    November 29, 2023

    No. The firmware is in ROM and not flexible to your needs.

    AN2606 defines the pins it can use.

    Super User
    November 29, 2023

    No, bootloader pins are hard coded and cannot be changed.

    Graduate II
    November 29, 2023

    @Arthur21 wrote:

    My question is : Is it possible to flash the device with USART2 but with USART2_TX located on PA14 and not PA2 ?


    Reply is yes you can, but no over system bootloader. Split flash and create custom bootloader.

    Arthur21Author
    Graduate
    November 29, 2023

    Ok thanks, I hadn't thought about that.
    I am novice in embedded systems. Can you tell me if remapping an ADC channel to another pin is possible ? I didn't succeeded in stmCube UI, I guess it is because of hardware limitations ? Or is it only adefault pin, and a software configuration is possible ?

    Thanks

    Graduate II
    November 30, 2023

    You dont write used package, but ADC channels is static. You have amount of channels based on package and core.