1. Hardware setup
You need an EM35x breakout board (which is part of the EM35x development kit) and a module that supports the USB MSD bootloader (such as EM3588, which we assume in this example).
Check your jumper settings on the EM35x breakout board (shown in picture below is revision C2). Important to check: J40 should have upper two pins shorted.
2. Upload the Application with MSD Application Bootloader Local Storage
Build an application with the bootloader type "Local storage" (under the "HAL configuration" tab in Ember Desktop app builder), then load the application you have built (which we have named "MSD_bootloader_EM3588_test.ebl" in this example) and the bootloader "msd-app-bootloader-local-storage.s37" (which is supplied as a pre-built image in the EmberZNet PRO stack release) to the chip.
You may wish to build a second application as the "upgrade image". When you build the application we suggest that you enable LED1 as the heartbeat LED, which is helpful as a simple indicator when the application is running (see step 4 below).
3. Enter bootloader mode
Ground PA5 (or press down the BOOTLOAD button near the bottom right corner of EM35x breakout board) while pressing and releasing the RESET button or doing a power-on-reset. The chip enters a FIB monitor mode (see EM3588-RM, section 7.5). No LED on the EM3588 module should be on at this time. Then send a carriage return from the physical UART (SC1) for the chip to enter bootloader (see AN772 section 1.4.1). The green LED0 on EM3588 module is lit now.
To avoid sending the carriage return to enter bootloader, you can define USE_BUTTON_RECOVERY to use another GPIO pin to enter bootloader mode (without going into the FIB monitor mode first). In this case you need to rebuild the msd-app-bootloader-local-storage bootloader image. The .eww workspace is provided in the stack release so you can build it in IAR yourself. Just add USE_BUTTON_RECOVERY in the “Defined symbols” box under project options -> C/C++ Compiler -> Preprocessor, and rebuild. Then load this modified bootloader to the bootloader area in step 2 when you upload an application to the chip. The default button on EM35x breakout board is button1 (PC6). If you wish to use another GPIO pin you can modify it too.
When you are in bootloader mode, you will see the green LED0 on EM3588 module is lit (see the picture in step 1).
4. Firmware upgrade
Plug in a USB cable to the USB port beside the EM3588 module (as shown in the picture in step 1) and to your PC. In Windows Explorer you should see a mass storage device show up.
Open this mass storage device, and drag and drop the .ebl file you want to upgrade with.
Unplug the USB cable. The firmware update should happen now, and you will see the red LED1 on the EM3588 module flashing which is a simple sign that the application you’ve just uploaded is running now.