diff --git a/examples/stm32/nucleo-f429zi-baremetal/Makefile b/examples/stm32/nucleo-f429zi-baremetal/Makefile index 98e3787b..2d2456ee 100644 --- a/examples/stm32/nucleo-f429zi-baremetal/Makefile +++ b/examples/stm32/nucleo-f429zi-baremetal/Makefile @@ -23,7 +23,8 @@ flash: firmware.bin # Requires env variable VCON_API_KEY set DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/2 -test: update +test: EXTRA_CFLAGS += -DUART_DEBUG=UART1 +test: update curl --fail -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt grep 'Ethernet: up' /tmp/output.txt grep 'MQTT connected' /tmp/output.txt diff --git a/examples/stm32/nucleo-f429zi-baremetal/main.c b/examples/stm32/nucleo-f429zi-baremetal/main.c index ce6e8382..c8bd14e8 100644 --- a/examples/stm32/nucleo-f429zi-baremetal/main.c +++ b/examples/stm32/nucleo-f429zi-baremetal/main.c @@ -44,7 +44,7 @@ int main(void) { gpio_output(LED2); // Setup blue LED gpio_input(BTN1); // Set button to input irq_exti_attach(BTN1); // Attach BTN1 to exti - uart_init(UART1, 115200); // Initialise debug printf + uart_init(UART_DEBUG, 115200); // Initialise debug printf MG_INFO(("Starting, CPU freq %g MHz", (double) SYS_FREQUENCY / 1000000)); diff --git a/examples/stm32/nucleo-f429zi-baremetal/mcu.h b/examples/stm32/nucleo-f429zi-baremetal/mcu.h index 8cda5c45..57ed552b 100644 --- a/examples/stm32/nucleo-f429zi-baremetal/mcu.h +++ b/examples/stm32/nucleo-f429zi-baremetal/mcu.h @@ -157,6 +157,10 @@ struct uart { #define UART2 ((struct uart *) 0x40004400) #define UART3 ((struct uart *) 0x40004800) +#ifndef UART_DEBUG +#define UART_DEBUG UART3 +#endif + static inline void uart_init(struct uart *uart, unsigned long baud) { // https://www.st.com/resource/en/datasheet/stm32f429zi.pdf uint8_t af = 7; // Alternate function