This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Task Manager doesn't execute Idle task

Hi,

  I'm leveraging the ble_app_cli example program for my project. The primary reason for this is that I need BLE and I need to be able store and retrieve log data which needs to survive across power cycles.  My plan is to use flashlog for this functionality.  I see that the only way to retrieve the logs is using the CLI.  Therefore, the ble_app_cli example seemed like a good place to start.  If I build and run this example on my nRF52840 DK, it runs correctly some of the time.  I always get the CLI menu when I press TAB, and the CLI commands are functional.  But sometimes, the battery level simulation data does not get output.  Other times it does.  After leveraging this code into my own project, I see the same behavior.  When the battery data does not get output, I tried setting a breakpoint in the call to NRF_LOG_PROCESS(), and I see that it doesn't get there.  So it looks like the idle task stops running once the CLI task starts, at least some of the time.

  Again, I'm able to see this behavior using the unmodified ble_app_cli example.  Another thing I noticed is that if I do not make a BLE connection, the app shuts down after about 3 minutes.  When this happens, all of the previous battery level updates are printed on the serial terminal.  So the data is getting logged, it's just not getting output because NRF_LOG_PROCESS is not running, because the idle task is not running.

00:03:22.000,183] <info> app: Battery level update: 87
Logs dropped (1)
[00:03:24.000,183] <info> app: Battery level update: 88
Logs dropped (1)
[00:03:26.000,183] <info> app: Battery level update: 89
Logs dropped (1)
[00:03:28.000,183] <info> app: Battery level update: 90
Logs dropped (1)
[00:03:29.939,758] <info> pwr_mgmt: Shutdown request 0
Logs dropped (1)
[00:03:29.939,758] <info> pwr_mgmt: Shutdown started. Type 0
Logs dropped (1)
[00:03:29.939,758] <info> pwr_mgmt: SysOff handler 0x000355D1 => ready
Logs dropped (1)
[00:03:29.939,758] <info> pwr_mgmt: Shutdown complet

  Any thoughts on how to fix this, or ideas for other approaches - possibly something that doesn't use task manager.  I don't see it used much in other examples.  Is it possible to use the CLI and BLE without task manager?

  Thanks...

Brian

Parents
  • Hi Brian

    Sorry, I seem to have misinformed you. The ble_app_cli example seems to be the only BLE example in our SDK utilizing the flashlog. I didn't think that was the case. 

    I have tested this on my end now, and I'm not able to see what exactly you're referring to? Are you expecting the battery measurements to print continuously or what? The battery level updates seem to work as intended at all times on my end, printing the battery levels every time I put the device to sleep or when the timeout occurs. The CLI library uses the task manager, so I think you'll have to use it.

    Yes, it should also be possible to start out with an example like the ble_app_uart and add the CLI to that.

    Best regards,

    Simon

Reply
  • Hi Brian

    Sorry, I seem to have misinformed you. The ble_app_cli example seems to be the only BLE example in our SDK utilizing the flashlog. I didn't think that was the case. 

    I have tested this on my end now, and I'm not able to see what exactly you're referring to? Are you expecting the battery measurements to print continuously or what? The battery level updates seem to work as intended at all times on my end, printing the battery levels every time I put the device to sleep or when the timeout occurs. The CLI library uses the task manager, so I think you'll have to use it.

    Yes, it should also be possible to start out with an example like the ble_app_uart and add the CLI to that.

    Best regards,

    Simon

Children
  • Hi Simon,

      When I ran the ble_app_cli app, it would sometimes print battery measurements each second.  Other times I ran it, I would get no output until the app reset after ~3 minutes of no BLE connection.  At this point, I would get a large number of battery measurements at the same time.

      I've switched to the ble_app_uart example, and added CLI and flashlog support to this example, with no task manager.  So far, it is working well, so I plan to keep going with this approach.

      Thanks for the help!

    Brian

Related