HardFault & DMA Descriptor Memory Issues in STM32F746G-Discovery Ethernet (LwIP) – Need Guidance for Cloud POST API Integration
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code and a linker script content. Please read this post: How to insert source code.
Hello Community,
I am working on STM32F746G-Discovery and trying to send ADC sensor data to a cloud server using Ethernet.
Cloud API details:
URL: https://iot.hummingbirdtek.com/api/data
Method: POST
Content-Type: application/json
What I Have Done:
-
Enabled Ethernet (RMII) in CubeMX
-
Enabled LwIP, set static IP
-
Enabled ADC1, UART6 for debug
-
Generated code (AC6/GCC)
-
Added code to format JSON and send to cloud using http_post
Issues I am facing:
1) HardFault occurs after LwIP initialization
The crash happens during:
MX_LWIP_Init(); netif_set_up();
2) DMA Descriptor Memory Configuration ErrorsCompiler shows errors like:
DMARxDscrTab memory out of range
or
aggregate value used where integer expected
I suspect incorrect MPU/Alignment/Section placement for:ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDecripSection")));
I am not sure how this should be configured in CubeMX linker settings for STM32F746.3) Need guidance for correct .ioc Ethernet/LwIP configuration
Specifically:
-
ETH clock settings
-
RMII pins required
-
LwIP static IP configuration
-
Required settings in lwipopts.h
-
Whether mbedTLS is required for HTTPS POST
-
If any official ST example project exists for STM32F746 + LwIP + HTTP POST
4) Request
Can someone please guide me with:
✔ Correct CubeMX IOC configuration steps
✔ Correct linker script placement for ETH DMA descriptors
✔ Any working example project (preferably F746G-DISCO)
✔ Any documents or references for fixing HardFault in LwIP initMy Goal:
Send ADC value as JSON to cloud through Ethernet:
{ "adc_value": 1024, "device": "stm32f746" }
Any help, guidance, or example code will be greatly appreciated.Thank you!
-
