Flash Loader – Example#

This section shows the steps on how to use the SEGGER template files to program the SiWx917 using the SEGGER JFlash.

Note: The SiWx917 SoC is not SEGGER Licensed, we included the Device name locally in JLinkDevices.xml file to shows this example.

Prerequisites#

The following hardware and software are required for programming the device.

Hardware#

  • SiWG917 SoC Kit (BRD4338A radio board + 4002A base board)

  • USB to Type C cable for powering the kit and flashing the application

  • A PC with USB ports

  • SEGGER J-Trace Pro with power cable

  • J-Link Adapter CortexM (You would get this with the J-Trace Pro when purchased)

  • 20-position socket to socket connector cable

Software#

  • J-Link software (This example is verified with the version V7.96f.)

  • Blinky example binary file can be downloaded here

  • Source Code for Flash Loader – Download here

  • Keil IDE (This example is verified with MDK version 5.29.0.0)

  • Simplicity Commander: Download here

Setup#

The image below illustrates the setup.

illustrates the setupillustrates the setup

  • The SiWx917 and the J-Trace are connected to a PC.

  • The SiWx917 debug pins (on the 4002A board) and J-Trace J-Link Adapter CortexM – Target pins are connected using a socket-to-socket connector.

  • Make sure the J-Trace Target power light is ON after connecting the socket-to-socket connector.

Programming the SiWx917 SoC with JFlash#

To program the SiWx917 SoC using the JFlash, you need a .elf file which is generated in the Keil IDE by compiling the Si917_Flashloader project.

The flash programming involves the following steps, which are explained in detail in the sub-sections.

  1. Generate the .ELF file in Keil IDE.

  2. Add the SiWx917 device to SEGGER devices (locally).

  3. Copy the .ELF file to the J-Link folder.

  4. Erase the SiWx917 chip.

  5. Program the SiWx917 using the JFlash.

Generate .ELF File in Keil IDE#

The following steps explain how to generate the Si917_Common_Flash.elf file.

  1. Download the SiWx917_Source_Code mentioned in the Software section.

  2. Unzip the SiWx917_Source_Code. It should be as below.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

  3. Got the Keil project path: [Downloaded_Path]\SiWx917_Source_Code\Si917_Flashloader. Open the Si917_Flashloader.uvprojx Keil project file which will open the Keil IDE with this project file.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

  4. Build the Project. This is generating the Si917_Common_Flash.elf file.

    Si917_Common_Flash.elf fileSi917_Common_Flash.elf file

  5. Go to the path: [Downloaded_Path]\SiWx917_Source_Code\Si917_Flashloader\Objects. You should see the Si917_Common_Flash.elf file.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

Add SiWx917 Device to SEGGER Devices (Locally)#

The following steps explain how to add the SiWx917 device to the SEGGER device locally.

  1. Download and Install the SEGGER J-Link software mentioned in the Software section.

  2. Once installed, go to the path: [Installed_Path]\ SEGGER\Jlink. Example: Here it is installed in the path: (C:\Program Files (x86)\SEGGER\Jlink). Open the JLinkDevices.xml file with an editor of your choice.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

  3. In the JLinkDevices.xml file, go to the end of the file and add the following text and then save the file as shown below.

    <Device>
     
    <ChipInfo Vendor="Silicon Labs" Name="Si917" Core="JLINK_CORE_CORTEX_M4" WorkRAMAddr="0x00000000" WorkRAMSize="0x00020000" />
       
    <FlashBankInfo Name="QSPI Flash" BaseAddr="0x08000000" MaxSize="0x00800000" Loader="Si917_Common_Flash.elf"      LoaderType="FLASH_ALGO_TYPE_OPEN" />
    
     </Device>
     

save the filesave the file

Copy the .ELF file to the J-Link Folder#

  1. Copy the Si917_Common_Flash.elf file generated in Step 5 in Section Generate .ELF File in Keil IDE as shown below.

    Copy the Si917_Common_Flash.elfCopy the Si917_Common_Flash.elf

  2. Paste the copied Si917_Common_Flash.elf file in the path: [Installed_Path]/SEGGER/Jlink as shown below.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

Erase Chip - SiWx917#

To confirm an example is loaded through the flash loader, first, erase the SiWx917 chip and keep it in IN mode using the Simplicity Commander by following the steps below.

  1. Download and Install Simplicity Commander mentioned in the Software section.

  2. Go to the path: [Installed_Path]\Simplicity Commander. Open Terminal and give the command: commander device masserase --device si917

    Go to the pathGo to the path A black screen with white text Description automatically generatedA black screen with white text Description automatically generated

  3. Go to the path: [Installed_Path]\Simplicity Commander. Double click the commander.exe.

  4. Click on Kit, change the Debug Mode from MCU to IN.

    change the Debug Modechange the Debug Mode

  5. Upon changing the Debug Mode, the Device will be shown as Cortex M4.

    Cortex MCortex M

Program Using the JFlash#

This section provides the steps to program the SiWx917 SoC using the JFlash.

  1. Go to the Path: [Installed_Path]\SEGGER\Jlink. You will find JFlash.exe in it.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

  2. Double click on JFlash.exe. This will open the SEGGER JFlash.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

  3. Select “Create new project” and click on Start J-Flash.

    Start J-FlashStart J-Flash

  4. Click on the “…” under the Target device. You will be re-directed to Target Device Settings. Search for Si917 under Device column and select it. Next, click on OK.

    Target deviceTarget device re-directed to Target Device Settingsre-directed to Target Device Settings Search for Si917Search for Si917

  5. In the Create New Project Window, click on OK.

    Create New ProjectCreate New Project

  6. Next, click on Target → Connect.

    Target to ConnectTarget to Connect

  7. In the Emulator selection pop-up window, select the J-Trace S/N. You can see the S/N on the backside of the J-Trace. Select the correct SN in the Emulator selection window. (Example: In the image below, the J-Trace S/N is 933001235, so SN 933001235 is selected). Next, click on OK.

    Select the correct SNSelect the correct SN

  8. Upon successful connection, you will see “Connected successfully” in the log window as shown below.

    Connected successfullyConnected successfully

  9. Click on File → Open data file…, and then go to the path where you downloaded the Blinky Binary file mentioned in the Software section. Next, select the sl_si91x_blinky_isp.bin file and click on Open.

    downloaded the Blinky Binary filedownloaded the Blinky Binary file select sl_si91x_blinky_isp.binselect sl_si91x_blinky_isp.bin

  10. Next, in the Enter start address pop-up window, give the Start address as 0x8201000 (This is the M4 MBR Start address). Then, click on OK.

    Enter start address pop-up windowEnter start address pop-up window

  11. Upon successful opening of the binary file, the JFlash screen will be shown as below.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

  12. To flash the blinky application onto the SiWx917 device, click on Target → Manual Programming → Program.

    click on Programclick on Program

  13. Upon successful programming, you will see “Target programmed successfully”.

    A screenshot of a computer Description automatically generatedA screenshot of a computer Description automatically generated

  14. After programming successfully, you will see the LED0 on the board blinking continuously. This proves that the application is flashed through the JFlash and is running as expected.

    running as expectedrunning as expected