mongoose/examples/stm32/nucleo-f746zg-make-baremetal-builtin-cmsis_driver
2024-09-02 11:06:10 -03:00
..
hal.h Add FRDM-MCXN947 2024-05-28 16:55:52 -03:00
link.ld Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
main.c Make mg_random() fallible. Abort TLS on weak RNG 2024-09-02 11:06:10 -03:00
Makefile Rename mongoose_custom as mongoose_config 2024-04-16 17:28:31 -03:00
mbedtls_config.h Add driver for CMSIS-Driver 2023-11-01 17:26:34 -03:00
mongoose_config.h Rename mongoose_custom as mongoose_config 2024-04-16 17:28:31 -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}