mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 15:01:03 +08:00
minor updates
This commit is contained in:
parent
fbaaf89a21
commit
491596d03d
@ -9,6 +9,12 @@ SOURCES = main.c startup.c syscalls.c ../../../mongoose.c
|
||||
FREERTOS_VERSION ?= V10.5.0
|
||||
FREERTOS_REPO ?= https://github.com/FreeRTOS/FreeRTOS-Kernel
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = cmd /C del /Q /F /S
|
||||
else
|
||||
RM = rm -rf
|
||||
endif
|
||||
|
||||
build example: firmware.bin
|
||||
|
||||
firmware.elf: FreeRTOS-Kernel $(SOURCES)
|
||||
@ -31,4 +37,4 @@ FreeRTOS-Kernel:
|
||||
git clone --depth 1 -b $(FREERTOS_VERSION) $(FREERTOS_REPO) $@
|
||||
|
||||
clean:
|
||||
rm -rf firmware.* FreeRTOS-Kernel
|
||||
$(RM) firmware.* FreeRTOS-Kernel
|
||||
|
@ -23,9 +23,9 @@ CFLAGS += -DSTM32F429xx
|
||||
CFLAGS += -Wno-conversion -Wno-sign-conversion
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = cmd /C del /Q /F
|
||||
RM = cmd /C del /Q /F /S
|
||||
else
|
||||
RM = rm -f
|
||||
RM = rm -rf
|
||||
endif
|
||||
|
||||
all build example: firmware.bin
|
||||
@ -45,4 +45,4 @@ flash: firmware.bin
|
||||
st-flash --reset write firmware.bin 0x8000000
|
||||
|
||||
clean:
|
||||
$(RM) firmware.*
|
||||
$(RM) firmware.* tinyusb
|
||||
|
@ -13,6 +13,12 @@ SOURCES += mongoose.c net.c packed_fs.c
|
||||
CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_NEWLIB -DMG_ENABLE_CUSTOM_MILLIS=1
|
||||
CFLAGS += -DMG_ENABLE_CUSTOM_RANDOM=1 -DMG_ENABLE_PACKED_FS=1 $(CFLAGS_EXTRA)
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = cmd /C del /Q /F /S
|
||||
else
|
||||
RM = rm -rf
|
||||
endif
|
||||
|
||||
all build example: firmware.bin
|
||||
|
||||
firmware.bin: firmware.elf
|
||||
@ -24,10 +30,10 @@ firmware.elf: cmsis_core cmsis_f7 $(SOURCES) hal.h link.ld
|
||||
flash: firmware.bin
|
||||
st-flash --reset write $< 0x8000000
|
||||
|
||||
cmsis_f7: # ARM CMSIS core headers
|
||||
git clone --depth 1 -b v1.2.8 https://github.com/STMicroelectronics/cmsis_device_f7 $@
|
||||
cmsis_core: # ST CMSIS headers for STM32F7 series
|
||||
cmsis_core: # ARM CMSIS core headers
|
||||
git clone --depth 1 -b 5.9.0 https://github.com/ARM-software/CMSIS_5 $@
|
||||
cmsis_f7: # ST CMSIS headers for STM32F7 series
|
||||
git clone --depth 1 -b v1.2.8 https://github.com/STMicroelectronics/cmsis_device_f7 $@
|
||||
|
||||
# Automated remote test. Requires env variable VCON_API_KEY set. See https://vcon.io/automated-firmware-tests/
|
||||
DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/5
|
||||
@ -41,4 +47,4 @@ test: update
|
||||
grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
|
||||
clean:
|
||||
@rm -rf firmware.* *.su cmsis_core cmsis_f7
|
||||
$(RM) firmware.* *.su cmsis_core cmsis_f7
|
||||
|
@ -75,7 +75,6 @@ static inline void gpio_output(uint16_t pin) {
|
||||
|
||||
static inline void irq_exti_attach(uint16_t pin) {
|
||||
uint8_t bank = (uint8_t) (PINBANK(pin)), n = (uint8_t) (PINNO(pin));
|
||||
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN; // Enable SYSCFG
|
||||
SYSCFG->EXTICR[n / 4] &= ~(15UL << ((n % 4) * 4));
|
||||
SYSCFG->EXTICR[n / 4] |= (uint32_t) (bank << ((n % 4) * 4));
|
||||
EXTI->IMR |= BIT(n);
|
||||
@ -133,7 +132,7 @@ static inline uint32_t rng_read(void) {
|
||||
return RNG->DR;
|
||||
}
|
||||
|
||||
#define UUID ((uint8_t *) 0x1ff0f420) // Unique 96-bit chip ID. TRM 41.1
|
||||
#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
|
||||
|
||||
// Helper macro for MAC generation
|
||||
#define GENERATE_LOCALLY_ADMINISTERED_MAC() \
|
||||
|
@ -17,6 +17,12 @@ CFLAGS += -IFreeRTOS-Kernel/portable/GCC/ARM_CM7/r0p1 -Wno-conversion
|
||||
SOURCES += ../../../mongoose.c # Mongoose options are defined in mongoose_custom.h
|
||||
CFLAGS += -I../../.. $(CFLAGS_EXTRA)
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = cmd /C del /Q /F /S
|
||||
else
|
||||
RM = rm -rf
|
||||
endif
|
||||
|
||||
all build example: firmware.bin
|
||||
|
||||
firmware.bin: firmware.elf
|
||||
@ -46,4 +52,4 @@ test: update
|
||||
grep 'READY, IP:' /tmp/output.txt # Check for network init
|
||||
|
||||
clean:
|
||||
@rm -rf firmware.* *.su cmsis_core cmsis_f7 FreeRTOS-Kernel
|
||||
$(RM) firmware.* *.su cmsis_core cmsis_f7 FreeRTOS-Kernel
|
||||
|
@ -23,9 +23,9 @@ CFLAGS += -DSTM32F746xx
|
||||
CFLAGS += -Wno-conversion -Wno-sign-conversion
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = cmd /C del /Q /F
|
||||
RM = cmd /C del /Q /F /S
|
||||
else
|
||||
RM = rm -f
|
||||
RM = rm -rf
|
||||
endif
|
||||
|
||||
all build example: firmware.bin
|
||||
@ -45,4 +45,4 @@ flash: firmware.bin
|
||||
st-flash --reset write firmware.bin 0x8000000
|
||||
|
||||
clean:
|
||||
$(RM) firmware.*
|
||||
$(RM) firmware.* tinyusb
|
||||
|
@ -14,6 +14,12 @@ CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_NEWLIB -DMG_ENABLE_PACKED_FS=1
|
||||
CFLAGS += -DMG_ENABLE_CUSTOM_RANDOM=1 -DMG_ENABLE_CUSTOM_MILLIS=1
|
||||
CFLAGS += -DMG_ENABLE_DRIVER_STM32H=1 $(CFLAGS_EXTRA)
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = cmd /C del /Q /F /S
|
||||
else
|
||||
RM = rm -rf
|
||||
endif
|
||||
|
||||
all build example: firmware.bin
|
||||
|
||||
firmware.bin: firmware.elf
|
||||
@ -25,10 +31,10 @@ firmware.elf: cmsis_core cmsis_h7 $(SOURCES) hal.h link.ld
|
||||
flash: firmware.bin
|
||||
st-flash --reset write $< 0x8000000
|
||||
|
||||
cmsis_h7: # ARM CMSIS core headers
|
||||
git clone --depth 1 -b v1.10.3 https://github.com/STMicroelectronics/cmsis_device_h7 $@
|
||||
cmsis_core: # ST CMSIS headers for STM32F7 series
|
||||
cmsis_core: # ARM CMSIS core headers
|
||||
git clone --depth 1 -b 5.9.0 https://github.com/ARM-software/CMSIS_5 $@
|
||||
cmsis_h7: # ST CMSIS headers for STM32H7 series
|
||||
git clone --depth 1 -b v1.10.3 https://github.com/STMicroelectronics/cmsis_device_h7 $@
|
||||
|
||||
# Automated remote test. Requires env variable VCON_API_KEY set. See https://vcon.io/automated-firmware-tests/
|
||||
DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/6
|
||||
|
@ -1,41 +1,3 @@
|
||||
# Baremetal webserver on NUCLEO-H743ZI
|
||||
# Baremetal web device dashboard on NUCLEO-H743ZI
|
||||
|
||||
This firmware uses MIP, an experimental TCP/IP stack of the Mongoose Network Library,
|
||||
which implements the following:
|
||||
|
||||
- A complete [HTTP device dashboard](../../device-dashboard) with:
|
||||
- User authentication
|
||||
- Real-time device data graph
|
||||
- Coninfiguration display and update
|
||||
- MQTT communication with a remote MQTT server
|
||||
- No dependencies: no HAL, no CMSIS, no RTOS
|
||||
- Hand-written [mcu.h](mcu.h) header based on the [datasheet](https://www.st.com/resource/en/reference_manual/rm0433-stm32h742-stm32h743753-and-stm32h750-value-line-advanced-armbased-32bit-mcus-stmicroelectronics.pdf)
|
||||
- Interrupt-driven [Ethernet driver](../../../drivers/driver_stm32h.c)
|
||||
- Debug log on UART3 (st-link)
|
||||
|
||||
## Requirements
|
||||
|
||||
- [GNU make](http://mongoose.ws/tutorials/tools/#gnu-make)
|
||||
- [ARM GCC](http://mongoose.ws/tutorials/tools/#arm-gcc)
|
||||
- [stlink](http://mongoose.ws/tutorials/tools/#stlink) for flashing
|
||||
|
||||
The links above will send you to tutorials on how to install each of those tools in your workstation for Linux, Mac, and Windows.
|
||||
|
||||
## Usage
|
||||
|
||||
Plugin your Nucleo board into USB, and attach an Ethernet cable.
|
||||
To build and flash:
|
||||
|
||||
```sh
|
||||
$ make clean flash
|
||||
```
|
||||
|
||||
To see debug log, use any serial monitor program like `picocom` at 115200 bps and configure it to insert carriage returns after line feeds:
|
||||
|
||||
```sh
|
||||
$ picocom /dev/ttyACM0 -i -b 115200 --imap=lfcrlf
|
||||
```
|
||||
|
||||
There is also a [tutorial on a similar example](https://mongoose.ws/tutorials/stm32/nucleo-f746zg-baremetal/) but for the NUCLEO-F746ZG board
|
||||
|
||||
For more details and benchmark data on MIP, check the [F746ZG example](../nucleo-f746zg-baremetal/)
|
||||
See https://mongoose.ws/tutorials/stm32/nucleo-h743zi-baremetal/
|
||||
|
Loading…
x
Reference in New Issue
Block a user