mongoose/examples/stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
2023-11-07 17:05:41 -03:00
..
hal.h Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
link.ld Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
main.c Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
Makefile standardize build options 2023-11-07 17:05:41 -03:00
mbedtls_config.h Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
mongoose_custom.h standardize build options 2023-11-07 17:05:41 -03:00
mongoose.c Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
mongoose.h Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
MX_Device.h Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
net.c Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
net.h Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
packed_fs.c Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
README.md Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
RTE_Components.h Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
syscalls.c Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
sysinit.c Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00

CMSIS-Driver example

Mongoose includes a driver for CMSIS-Driver, that is, Mongoose built-in TCP/IP stack can run over any (ARM) chip that has a CMSIS Driver for its Ethernet controller, and uses a PHY that also has a CMSIS Driver. You can follow this example to use Mongoose there, the Makefile in this example performs the following list of actions.

Actions:

  • Pull CMSIS core, this also includes the basic support for CMSIS Driver
  • Pull CMSIS Driver, this repository has driver code for several widely used PHYs and some Ethernet chips (stand-alone controllers, not MCUs)
  • Pull the device family CMSIS Pack, this includes CMSIS headers and also includes CMSIS Drivers for those peripherals that have Middleware (Ethernet, CAN, UART...) available
  • The rest of the job is to find and solve the driver dependencies. In this example, the CMSIS Driver for the STM32F746 uses the STM32 HAL, so we have copied some files from an STM32CubeMX generated project in order to have some defines available, then picked the correct sources to compile, and provided a HAL_GetTick() function to satisfy those parts of the HAL that use it, without having to include more pieces of the HAL, as we already have a time base in place.
  • Finally,
    • enable the driver by defining MG_ENABLE_DRIVER_CMSIS=1

    • select it in your main.c

      struct mg_tcpip_if mif = {.driver = &mg_tcpip_driver_cmsis}