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

CONFIG_HEAP_MEM_POOL_SIZE and k_malloc, k_free not working in nrf51_pca10028 #21599

Closed
stephenmasih opened this issue Dec 27, 2019 · 4 comments
Closed
Assignees
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: low Low impact/importance bug Waiting for response Waiting for author's response

Comments

@stephenmasih
Copy link

Describe the bug
I my application i am using the board nrf51_pca10028. I the prj.conf file I am defining a CONFIG_HEAP_MEM_POOL_SIZE=1024 for involving a k_malloc() and k_free(). Even when I define a thread in the kernel it doesn't seem to show any output. When I replace the entire thread code in the main thread it works fine in nrf52, not in nrf51. The code works fine with board nrf52_pca10040. But it shows no output in the console with nrf51.

To Reproduce
Steps to reproduce the behavior:

  1. west build -b nrf51_pca10028 --pristine
  2. west flash

Expected behaviour
There should be dynamic allocation of memory for my linked list in the Bluetooth application.
t_ble_scan() is a thread function and main() thread is also defined.
Screenshot from 2019-12-24 17-24-07

@stephenmasih stephenmasih added the bug The issue is a bug, or the PR is fixing a bug label Dec 27, 2019
@stephenmasih stephenmasih changed the title CONFIG_HEAP_MEM_POOL_SIZE and k_malloc, k_free defines doesnot work with nrf51_pca10028 CONFIG_HEAP_MEM_POOL_SIZE and k_malloc, k_free not working in nrf51_pca10028 Dec 28, 2019
@carlescufi
Copy link
Member

@joerchan could you try to reproduce this?

@stephenmasih
Copy link
Author

stephenmasih commented Dec 31, 2019

I tried debugging, any code defined inside a thread. The code gets compiled i am able to get the zephy.hex file. But the code does not work at all. The same code I tried with nrf52, everything seems to be okay. As you can see above in the screenshot t_ble_scan() doesnot work in nrf51 but it does in nrf52 boards. Please help.

@joerchan
Copy link
Contributor

joerchan commented Jan 3, 2020

@stephenmasih I have no way to reproduce this issue. Please update with a description on how I can reproduce it. I cannot really do anything with a screenshot.

You are not checking the returned value of k_malloc, you probably should check that it is infact non-zero before using it.

@joerchan joerchan added the Waiting for response Waiting for author's response label Jan 6, 2020
@jhedberg jhedberg added the priority: low Low impact/importance bug label Jan 7, 2020
@carlescufi
Copy link
Member

@stephenmasih I am closing this issue since there has been no activity on it for a while. Please reopen with guidance on how to reproduce if this is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: low Low impact/importance bug Waiting for response Waiting for author's response
Projects
None yet
Development

No branches or pull requests

4 participants