Hello, I have a mcxn947 development board on my hand and I wanted to try out halow on the nxp mcu. How can I port the firmware to my build? For your information, mcxn947 has 2 M33 core and contain 2MB flash and 512KB SRAM internally. NXP has their own develop tool called mcuxpresso.
Hi @TomC818
My apologies for the late reply! Didn’t hit send on the message below!
At the moment we deliver a microcontroller SDK via the Morse Micro IoT-SDK. Think of this as a large collection of libraries, which you could pull into your own platform as required. This part should be largely compatible with the SDK, as there is a Cortex-M33 firmware binary available!
We understand that this can be a fairly challenging exercise to perform a platform port in this SDK, as there a number of platform specific abstraction layers which need to be implemented, and we also recognise that there is a lack of documentation to guide on exactly how to perform this sort of port. We’re writing a porting guide, to help guide people like you who are wanting to try HaLow on platforms we do not yet explicitly support in this SDK, but it will be some time before that guide is made available. I’ll make an effort to update this post when it is available.
Instead, if you’re willing to run Zephyr, you would be able to leverage the mm-iot-zephyr module. While our Zephyr module is an Alpha port, and currently has some throughput and power save limitations, it is significantly easier to bring up HaLow with the only changes required being build config or device tree.
Thanks for the reply! I would be happy to use Zephyr, would there be any tutorial on how to port and use the zephyr module? Like the APIs and the device tree binding properties available. PS, I am just getting started with zephyr, please be patience if the questions sound stupid.
The only “guide” at the moment is the README at the top level of the module directory. If you’re new to Zephyr, I’d definitely recommend following the Zephyr Getting Started Guide first for the 3.7.0 LTS release - see Getting Started Guide — Zephyr Project Documentation
Take careful note of the “Install Dependencies”, I’ve personally tripped up on that in the past.
From the basic getting started, adding the Morse Micro HaLow module to the build system is simply updating your west.yml to add the module. The README should cover this.
Regarding APIs, our Zephyr module registers as a network device in Zephyr, so you will be using the same APIs as any other network interface, with wifi management for control. See BSD Sockets — Zephyr Project Documentation and Wi-Fi Management — Zephyr Project Documentation
Device tree may be the most involved bit. The bindings for our device (SPI attached) are available mm-iot-zephyr/dts/bindings/wifi/morse,spi.yaml at main · MorseMicro/mm-iot-zephyr · GitHub but you may find it more suitable to look at an example. See our mm6108-ekh05 board in the tree for config and dts: mm-iot-zephyr/boards/morsemicro/mm6108_ekh05_v3 at main · MorseMicro/mm-iot-zephyr · GitHub
We’ve provided a halow_client example in our module which is identical to the wifi_client example in the Zephyr root tree, but enabling Wi-Fi HaLow. This gives you a shell in which you can scan/connect/ping. Helpful when bringing up a board for the first time before jumping into application development.
Feel free to share any device tree overlays or other configuration you produce, happy to help review and provide suggestions as required.
Hi @TomC818
We set up an mmech08 shield (MMECH08 v2 Design Package) which is only distributed with this kit for the FRDM-MCXN947 board with our Zepyhr port. (edited)
You can apply this patch to the zephyr repository for mapping the SDIO pins from the MMECH08 and FRDM board.
Take note that we remapped the A0 and A1 pins on the FRDM board to correspond with D3 and D4. This will also require you to physically hardwire these pins on the shield if you are using the MMECH08
diff --git a/boards/nxp/frdm_mcxn947/arduino_r3_connector.dtsi b/boards/nxp/frdm_mcxn947/arduino_r3_connector.dtsi
new file mode 100644
index 00000000000..7e5501b25b3
--- /dev/null
+++ b/boards/nxp/frdm_mcxn947/arduino_r3_connector.dtsi
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019, Christian Taedcke
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/ {
+ arduino_header: connector {
+ compatible = "arduino-header-r3";
+ #gpio-cells = <2>;
+ gpio-map-mask = <0xffffffff 0xffffffc0>;
+ gpio-map-pass-thru = <0 0x3f>;
+ gpio-map = <0 0 &gpio4 12 0>, /* A0 */ /* NOTE Taking actual mapping from D3 */
+ <1 0 &gpio1 0 0>, /* A1 */ /* NOTE Taking actual mapping from D4 */
+ <2 0 &gpio0 14 0>, /* A2 */
+ <3 0 &gpio0 22 0>, /* A3 */
+ <4 0 &gpio0 15 0>, /* A4 */
+
+ <5 0 &gpio0 23 0>, /* A5 */
+
+ <6 0 &gpio4 3 0>, /* D0 */
+ <7 0 &gpio4 2 0>, /* D1 */
+
+ <8 0 &gpio0 29 0>, /* D2 */
+
+ <9 0 &gpio2 0 0>, /* D3 */ /* NOTE - Remapped to FRDM Header 1 */
+ <10 0 &gpio1 22 0>, /* D4 */ /* NOTE - Remapped to FRDM Header 3 */
+
+ <11 0 &gpio1 21 0>, /* D5 */
+ <12 0 &gpio1 2 0>, /* D6 */
+ <13 0 &gpio0 31 0>, /* D7 */
+ <14 0 &gpio0 28 0>, /* D8 */
+
+ <15 0 &gpio0 10 0>, /* D9 */
+
+ <16 0 &gpio0 27 0>, /* D10 */
+ <17 0 &gpio0 24 0>, /* D11 */
+ <18 0 &gpio0 26 0>, /* D12 */
+ <19 0 &gpio0 31 0>, /* D13 */
+
+ <20 0 &gpio4 0 0>, /* D18 */
+ <21 0 &gpio4 1 0>; /* D19 */
+ };
+};
+
+
+arduino_spi: &flexcomm1_lpspi1 {};
diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts
index 0651a532a18..afce71fc187 100644
--- a/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts
+++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts
@@ -8,6 +8,7 @@
#include <nxp/nxp_mcxn94x.dtsi>
#include "frdm_mcxn947.dtsi"
+#include "arduino_r3_connector.dtsi"
/ {
model = "NXP FRDM_N94 board";