How To Get Started With nRF5340 Module Program Coding and Compiling

Intro:

As the chipset of nRF5340 is built by Dual Core structure (net core and application core), we need to proceed the coding and compiling process individually to net core & application core.

After the coding and compiling process done, we could get the separate zephyr.hex file respectively which are used for BLE module FW.

 Firmware Development Steps : Code Building / Compiling

Case Study : 

    NON-Audio Project

  nRFConnect SDK V2.1.2

    Nordic Example code -“hci_rpmsg” & “peripheral_uart”

  1. Nordic example code of “hci_rpmsg” extracted for coding and we will get zephyr.hex file for net core
  2. Nordic example code of “peripheral_uart” extracted for coding and we will get zephyr.hex file for application core

Step 1. Net core Layer

1a) Activate “Open VS Code” IDE in NCS V2.1.2

1b) Select “Add an existing application” and extract “hci_rpmsg” file moving forward

1c) Click “Add Build Configuration” icon

1d) Select “nrf5340dk_nrf5340_cpunet” and check Nordic boards then Execute “Build Configuration”

1e) zephyr.hex file is successfully generated for net core layer if the coding process is properly executed

Step 2. Application core Layer:

2a) Activate “Open VS Code” IDE in NCS V2.1.2

2b) Select “Add an existing application” and extract “peripheral_uart” file moving forward

2c) Click “Add Build Configuration” icon

2d) Select “nrf5340dk_nrf5340_cpuapp” and check Nordic boards, then Execute “Build Configuration”

2e) zephyr.hex file is successfully generated for application core layer if the coding process is properly executed

Find more nRF5340 module development resources in below link

How To Get started with MDBT53/53V Demo Board Set up (MDBT53-DB-40/MDBT53V-DB-40)

How To USE Nordic Connect SDK (NCS) Flashing Built Code into nRF5340 Module

Raytac Corporation 勁達國際電子有限公司
A BT5.2 & BT5.1 & BT5 module maker based on Nordic nRF53 & nRF52 solution 
(nRF5340 & nRF52840 & nRF52833 & nRF52832 & nRF52820 & nRF52811 & nRF52810 & nRF52805)
www.raytac.com email: service@raytac.com Tel: +886.2.3234.0208

Firmware Coding & DFU onto MDBT50Q-RX

Hi there, 

Here introduce the firmware perspective about how to program your code onto MDBT50Q-RX dongle.

Believed all readers have done the hardware setting and now has well prepared to load the code onto the dongle. (If not yet done the hardware setting, pls find it here)

In this blog, we will introduce the procedure based on below 2 scenarios

  • First time to load the code
  • DFU Firmware update by USB or OTA (through Bluetooth over the air)

Bluetooth Project: How to program your firmware to module

After setup been done, here comes the next question: How to program the firmware in to the module. We are using some simple instruction in below for reader’s quick reference.

Hardware

You will need a Nordic nRF5X DK or a Segger J-link as programmer to load the firmware. To use Nordic nRF5X DK to debug the SoC as well, you will need to order corresponding nRF5X DK to match the SoC number. For example, order nRF52840 DK to debug nRF52840 SoC or order nRF52 DK to debug nRF52832/52810 SoC. But if you are only using it as programmer, any version of nRF5X DK will work as we only use the J-link on this board.

Software

Please download Nordic nRFGo Studio for programming. Remember to install nRF5X Command Line Tools if the board was not detected by nRFGo Studio. Once they are all connected, you can then start programming. Please make sure to “erase all” every time before programming.

For more tutorials and demo of sample code, please visit Nordic’s DevZone and Infocenter where have ample resources to utilize.

Programing 

SoftDevice + Application

  1. Erase all first. Then program Softdevice and follow by Application code.
  2. Or you may combine code as stated in above. Erase all and follow by programing the combined code.

SoftDevice + Bootloader+ Application

  1. Either Erase all first.  Program the Softdevice and follow by Bootloader. and then use DFU to update the application code.
  2. Or suggested having a combined code (SofDevice+Application+Bootloader) for program. Simply erase all and follow by programming the combined code.
*Remark
Bootloader is needed for DFU (OTA) Function.
SDK 11 (included) and before – a legacy DFU method, which is simple but less security
SDK 12 (Included) and after – a latest DFU method, which has higher security.

 

To easy customer’s IoT device mass production, Raytac provide code pre-program service into module before shipment.  There are requirements listed in below for customers who need the service!

  1. A single, combined hex file is required. Please combine softdevice and application or/and bootloader (depending on your firmware design) together before programming. This will shorten programming time and help to manage your code easier. If you are not familiar with merging firmware, please download the instruction from the link:     https://mega.nz/#!Qg5UBJTQ!POWmmNNdapGqefHpB10YjpcuExLWwXnxDfBzcVrsTOw
  2.  Need a simple method to check programming status. The easiest way is to check the device name if device will broadcast device name after programming is done; or use I/O to trigger LED and its behavior. This does not aim to test any or full function of your device, only a simple method for the operator to know programming status.

nRF52840 MDBT50Q Module
nRF52840 MDBT50Q Module

 

Raytac Corporation
A BT4.1 & BT4.2 & BT5 module maker based on Nordic nRF51 & nRF52 solution 
(nRF51822 & nRF51422 & nRF52832 & nR52810 & nRF52840)
www.raytac.com          email: cs@raytac.com          Tel: +886.2.3234.0208