Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemInit() fails when using cmsis_os2 abstraction layer #5

Closed
dsilva-vd opened this issue Apr 28, 2022 · 2 comments
Closed

MemInit() fails when using cmsis_os2 abstraction layer #5

dsilva-vd opened this issue Apr 28, 2022 · 2 comments

Comments

@dsilva-vd
Copy link

dsilva-vd commented Apr 28, 2022

Caution

The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post your report to the ST Community in the STM32 MCUs dedicated page.

Describe the set-up

  • The board (either ST RPN reference or your custom board)
  • IDE or at least the compiler and its version

Describe the bug (skip if none)

A clear and concise description of what the bug is.

How to reproduce the bug (skip if none)

  1. Indicate the global behavior of your application project
  2. List the modules that you suspect to be the cause of the problem (Drivers, BSP, MW...)
  3. Describe the use case that generates the problem
  4. How we can reproduce the problem

Additional context

If you have a first analysis, an enhancement, a fix or a patch, thank you to share your proposal.

Screenshots

If applicable, add screenshots to help explain your problem.

STM32CubeIDE version 1.8.0
STM32CubeMX version 6.4.0
Board -> NUCLEO-F429ZI (Nucleo 144)

I am porting X-cube-cellular version 7.0.0 to the STM32F4 platform. My code compiles and runs but the call to MemInit () in osKernelIntialize() fails when it calls tx_byte_pool_create().

I created my project using CubeMX and set it up for Azure RTOS F4 Software package. I have kept the NetX and TX defines the same as the X-Cube-cellular project (B-L462E-CELL1->Nx_TCP_Echo_Client_PPP). I have attached my complete project below. I'm sure this has something do with CubeMX configuration and using the abstraction layer but I have no idea where to start debugging. Any help is very appreciated! Thanks

Cellular2_AzRTOS_F429.zip

@dsilva-vd
Copy link
Author

From further debugging I have discovered the following:

MemInit() fails because
tx_byte_pool_create() is returning TX_PTR_ERROR because
_txe_byte_pool_create() argument VOID* pool_start is NULL

pool_start is set to _tx_initialize_unused_memory which is NULL.

@dsilva-vd
Copy link
Author

I found I forgot to initialize a place in Flash linker script for the threadx stack. You also have to turn on the dynamic memory allocation #define in the tx_initialize_low_level.s file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant