Built in uart bootloader on Energy micro devices

Started by jocelynmass, July 03, 2013, 12:47:19 PM

Previous topic - Next topic

jocelynmass

Hello,

I work on a EM-32G210F128-H development board, and I would like to know if anyone has managed the built in uart bootloader working on this board?

Thank you,

Jocelyn Masserot

cprogrammer

Hello Jocelyn Masserot

I don't have this board. But according to Application Note about USART Bootloader:
http://cdn.energymicro.com/dl/an/pdf/an0003_efm32_uart_bootloader.pdf
default used is USART0 on location 0 used.
The following PINs are used:
PE10 (USART 0 TX)
PE11 (USART 0 RX)

On the schematic of EM-32G210F128-H Board https://www.olimex.com/Products/ARM/EnergyMicro/EM-32G210F128-H/resources/EM32G210F128H-schematic.pdf
you can see, that these PINs are on UEXT 7 (PE11) and UEXT 8 (PE10).

whish you success

Stefan

jocelynmass

Hello Stefan,

Thank you very much for your reply. I already saw this application note, unfortunately it doesn't work. That's why I wondering if the in built uart bootloader is really preprogrammed on MCU.

Best regards,

Jocelyn

cprogrammer

Hello Jocelyn

If you had really done everything like it's written on Application Note, you could maybe look on the Energy Micro Forum there were people with similar Problems but on an other Board:
http://forum.energymicro.com/topic/837-gecko-stk-uart-bootloader/
http://forum.energymicro.com/topic/159-bootloader-on-development-kit/#entry246

What kind of connection are you using from your PC to your Board? Baudrate?
What's about the Voltage? 3.3 V not 5V should it be according to the Datasheet: http://cdn.energymicro.comw/dl/devices/pdf/d0004_efm32g210_datasheet.pdf
What do you do with the DBG_SWDCLK PIN PF0, on Debug Interface Pin 9?

Regards Stefan

jocelynmass

Hello Stefan,

Thank your for the links. I use a FTDI USB dongle to communicate with minicom software on my computer. The baudrates are set to 115200. The SWDCLK pin is pulled up to 3.3V and SWDIO pin is pulled down. Everythings seems to be ok. Maybe the uart bootloader was erased by Olimex.

Thank you,

Jocelyn

cprogrammer

Hello Jocelyn Masserot
Why you don't reprogram the Bootloader?

Look on page 9 on http://cdn.energymicro.com/dl/an/pdf/an0003_efm32_uart_bootloader.pdf

in this folder you can find the Binarys and iar project:
C:\Users\"your windows user name"\AppData\Roaming\energymicro\an\an0003_efm32_uart_bootloader

Regards

Stefan

jocelynmass

Thank Stefan

Indeed I've to reprogram the Bootloader in EM flash memory.

Regards,

Jocelyn

LubOlimex

Hey guys,

You've been very helpful. I also tried to run the bootloader and decided to share my experience - maybe it would be helpful for someone in future.

I just checked the situation about the bootloader – we indeed wipe it during testing. It is stored in the flash memory and we overwrite it. But if you have a SWD programmer you might get the bootloader back on the board – I tested it here and it works (not very fancy bootloader but works).

You can download back the bootloader via the DEBUG (SWD) interface. You would need a third party SWD-capable (JTAG will NOT do the job) programmer and the libraries available at the Energy Micro web-site. You need the Simplicity Studio that can be download here: http://www.energymicro.com/downloads/energyaware-software. When you run the installer I highly recommend you to keep the default install paths. Then run it and go Downloads –> Add/Remove and choose to download the following:

1. In Application notes –> AN0003 UART bootloader (maybe AN0042 if you don't use USB)
2. In Software –> CMSIS
3. In Software –> EM_BSP_COMMON

After all three are downloaded navigate to: C:\Users\<current computer user name>\AppData\Roaming\energymicro\an\an0003_efm32_uart_bootloader (you need to have the hidden folders visible). Open the "iar" folder where the bootloader.eww IAR EW workspace file is located.

When you open the workspace select the project named "bootloader-gecko" and its release variant from the drop down menu at the top of the explorer. You need to change few settings in the project properties – select the EM32G210F128 microcontroller and also ensure your debugger is set to SWD interface.

Everything should debug and upload properly now.

After that you need to PULL-UP pin 9 of the DEBUG connector – this means you have to disconnect the debugger and connect the pin to 3.3V source of power (for safety via a proper resistor). I just connected pin 9 to pin 1 with female-female jumper cable (I powered the board via the UEXT pins 1 and 2; but you might use a Li-Po battery also). Then you would have response on the RX and TX (respectively PE11-US0_RX, PE10-US0_TX) – this is located on UEXT pin 7 and 9. Note that the orientation of the UEXT connector is such that pin 1 and pin 2 are the nearest to the LiPo connector!

When everything is connected you might press button RST and then nothing would appear on the terminal (I used 115200 baud for it, but the bootloader uses auto-bauding) but if you press the enter button the chip's ID would be then printed. You can then check if the board resets properly following the documentation of the bootloader – I tested command "r" which resets the board. When I disconnect the PULL-UP on pin 9 and then write "r" and press enter – the board resets and doesn't enter bootloader mode again. If the pin 9 is connected to pin 1 for 3.3V and I write "r" it resets and prints the chip ID again.

I forgot to mention I use this small adapter board for USB connection: https://www.olimex.com/Products/Modules/Interface/MOD-USB-RS232/ (and a total of 5 jumper cables – 2 for UART + 2 for POWER + 1 for pulling up pin 9 of DEBUG connector, since the needed signals are on the default SPI pin places – so the UEXT connectors are not compatible out-of-the-box).

Regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

cprogrammer

Quote from: LubOlimex on August 23, 2013, 04:46:09 PM
1. In Application notes –> AN0003 UART bootloader (maybe AN0042 if you don't use USB)

One correction:
AN003 is about the UART bootloader but AN0042 is about the USB Bootloader, but Olimex EFM32 Boards are all based on the "oldest" Gecko microcontroller from Energymicro (now Silicon labs). The Gecko serie uC doesn't contain USB, so if you use an Olimex Energymicro Board, there is no possibility to use the USB bootloader  ;)

I am looking forward to new Olimex Boards which maybe would contain one of the "newer" EFM32 uC, for example Leopard Gecko...
Some of them would also have built in USB, so there it would be possible to use the USB bootloader.
There are some more interesting features which the Gecko serie doesn't contain: LESENCE (for touch, inductive, light or other sensors), BURTC, TFT, built in OPAMP, ETM.

Are there any plans for new Olimex EFM32 based Boards?

Regards

Stefan

msr

Quote from: LubOlimex on August 23, 2013, 04:46:09 PM
hen you would have response on the RX and TX (respectively PE11-US0_RX, PE10-US0_TX) – this is located on UEXT pin 7 and 9.

Thanks for the detailed instructions, but I still didn't manage to get it working.  Actually, PE10-US0_TX is connected to pin 8 (not 9).

I successfully compiled the bootloader and downloaded it with a J-Link EDU. Then I pulled up the DBG_SWCLK pin by connecting pin 9 to pin 1 of DBG connector. Im using an FTDI breakout board to access RX and TX pins. Then, when I press the reset button nothing is printed on the terminal (Im using 115.2kbaud 8N1) nor when 'U' or ENTER key is pressed.

Any suggestions?

cprogrammer

Do you transmit LF and CR at end of line? (some tools, terminal doesn't do this automatically)

msr

Quote from: cprogrammer on March 24, 2014, 08:34:15 AM
Do you transmit LF and CR at end of line? (some tools, terminal doesn't do this automatically)

cprogrammer, thanks for your help!
Actually, somehow I messed up the bootloader's code while I was trying to get it to work with the Gecko STK (which has the PE10 and PE11 pins connected to LCD). Now I tried to upload the .bin available with a fresh installation of Simplicity Studio and it worked as expected. No LF and CR at end of line needed :)