Tutorials - nits and mqtt client adoption

This commit is contained in:
cpq committed 2026-11-18 20:28:36 +00:00
1 parent 069ab78c02
commit 28e3b347d4
8 files changed
+14 -5

No files matched your search

@@ -15,6 +15,7 @@ CFLAGS += -mcpu=cortex-m33+nodsp -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 $(CF
LDFLAGS ?= -Tlink.ld -nostdlib -nostartfiles --specs=nano.specs -lc -lgcc -Wl,--gc-sections
SOURCES = main.c hal.c startup.c flexspi.c flash_config.c $(MGDIR)/mongoose.c
SOURCES += $(MGDIR)/tutorials/mqtt/mqtt-client/mongoose_mqtt.c
SOURCES += cmsis_rw612/devices/RW612/drivers/fsl_clock.c
SOURCES += cmsis_rw612/devices/RW612/drivers/fsl_trng.c
SOURCES += cmsis_rw612/devices/RW612/drivers/fsl_reset.c
@@ -44,5 +45,8 @@ flash: firmware.bin
(echo 'loadfile firmware.elf'; echo 'reset'; echo 'exit';) | JLinkExe -device RW612 -if SWD -speed 4000 -autoconnect 1 -NoGui 1 -ExitOnError 1
# JRun --nogui --device RW612 --if SWD firmware.elf
erase:
(echo halt && echo exec EnableEraseAllFlashBanks && echo erase && echo exit) | JLinkExe -device RW612 -if SWD -speed 4000 -autoconnect 1 -NoGui 1 -ExitOnError 1
clean:
rm -rf firmware.* cmsis_* mongoose/mongoose.*
+2
View File
@@ -104,6 +104,7 @@ int main(void) {
// Start a minimal web server
struct mg_mgr mgr;
mg_mgr_init(&mgr);
mg_mqtt_init(&mgr);
mg_http_listen(&mgr, "http://0.0.0.0", http_ev_handler, NULL);
mg_http_listen(&mgr, "https://0.0.0.0", http_ev_handler, NULL);
@@ -113,6 +114,7 @@ int main(void) {
for (;;) {
mg_mgr_poll(&mgr, 0);
mg_mqtt_poll(&mgr);
blink_task();
}
@@ -9,10 +9,11 @@
#define MG_ENABLE_CUSTOM_RANDOM 1
#define MG_OTA MG_OTA_RW612
#define MG_TLS MG_TLS_BUILTIN
#define MQTT_CLIENT_ID "rw612" // For tutorials/mqtt/mqtt-client
#define MG_ENABLE_MDASH 0 // Set to 1 to enable https://mdash.net
#define MG_MDASH_KEY "..." // Edit, see https://mdash.net/docs/#mongoose-library
#define MG_FIRMWARE_VERSION "1.0.1"
#define MG_FIRMWARE_VERSION "rw612.1.0.1"
// #define MG_DRIVER_MDC_CR 51 // RMII MDC clock divider
// #define MG_DRIVER_MDC_HOLDTIME 3 // RMII MDC Holdtime (valid values [0-7])