Thanks to tariq.ahmad, I got two NUCLEO-WL55JC1 Nucleo boards delivered to me this week. In this intro blog post, we will see the specification of the board and how to run a simple “Hello world” program using MBED cloud.
The following details are taken directly from ST and MBED OS official product webpage. I have included the ones that are important.
- Dual core 32bit ARM cortex controllers
- M4 is the one we use for peripheral programming and stuffs (Ex: LEDs on the Nucleo board)
- M0+ is the radio controller
- 256-Kbyte Flash memory and 64-Kbyte SRAM
- RF transceiver (150 MHz to 960 MHz frequency range) supporting LoRa, (G)FSK, (G)MSK, and BPSK modulations3 user LEDs
- 3 user buttons and 1 reset push-button
- SMA antenna.
- Mass storage, VCOM port and a debug port.
- Most importantly it supports LoRaWAN, Sigfox, wM-Bus, and many other proprietary protocols. Supporting libraries are already available with STM32Cubeide.
- Like the regular Nucleo/Disco boards this STM32 boards also includes a convenient inbuilt STLINK-V3 debugger.
- On connecting to programmer, it asks you to upgrade the debugger firmware.
- When you connect the Nucleo port to your system, it will open up a storage drive. The storage has a single file on clicking it will redirect you to MBED official page for this particular model.
The board comes with a near Arduino UNO farm factor (excluding the Antenna of course). As usual, all the Nucleo Boards that supports Morpho headers allows users to make use of most of the controller’s I/O pins.
On plugging in, we will be greeting with a LED dancing sequence preprogrammed in the controller.
Programming the controller
For creating application, I selected MBED cloud studio as I wanted to test the basic working without installing the toolchains and all.
- Log into your ARM developer account and select Keil cloud studio. You will be greeted with a VS code like interface.
- Select “New Project” from the left side pane. Select the default blinky example and give it a proper name. I have entered “hello_world” as mine. Click Add project.
- Now the interface will be created with a blinky template without a hardware model specified. From the left side pane, select “Nucleo-WL55JC” as build target.
- You will see the cloud IDE populated with LED blink template with our board as target. The example will turn On/Off the blue LED in the board at an interval of 500ms.
- Now let's add serial port to see the LED GPIO’s current state. Enable the UART port connected to USB interface. Set the baud rate as 115200. Add the print statement.
- One sweet advantage of using MBED cloud studio is you can directly flash the firmware on your board from your browser or you can download the compiled binary file. Click the build icon to compile the code, “Run” icon to compile and flash the binary, “Bug” icon to debug your application and “console” icon to enable serial monitor.
- Plug in your board and add the device. Browser will list the debugger, select and click “connect”. You will see your device connected and available for direct flashing.
- Click the run button on browser, you will be presented with two cortex processor, select “CM4” to run our application.
- If controller does not automatically reset into boot mode, press reset button when “Asset hardware reset” line is printed on screen.
- On successful flashing, you will see the blue LED flashing at 500ms, enable serial monitor and select baud rate as 115200.
- On serial monitor console, we will the current status of LED printed at 500ms interval.
- The first controller is loaded with test code and the second one is running with preprogrammed code.
Debugging the controller
MBED cloud also allows us to debug our application directly from browser itself. For convenience I have moved the LED logic into a separate function and added that function to breakpoint.
On entering the function, we can see the state the registers and etc.
Overall, I have tested the working of controller and the STLink over web with a basic LED example. In upcoming blog posts, we will see how to use this module to transmit messages wirelessly and build some applications.