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

J-link monitor mode debugging with app scheduler ( SDK13 / s332 4.0.5)

Segger Embedded Studio V5.20a / SDK13 (file structure from a legacy project) / BLE / ANT+ s332 4.0.5

I am in the process of moving from command line build (armgcc make) to debugging in SES with all the ide features.

I am able to debug as expected so far but need to be able to setup the project to work with jlink monitor mode - as I don't want hard faults.

I hope I can do this with SDK13 and ANT+ s332 soft device!

I have also been looking at the demo for the j-link monitor mode using a pca10040 and SDK16 

https://github.com/NordicPlayground/j-link-monitoring-mode-debugging/blob/master/pca10040/s132/ses/README.md

The legacy app I am working on uses the app scheduler - can you give me any advice what I should be doing with the monitor functions to keep the softdevice happy?

the device normally goes to sleep mode if it has nothing to do.

void JLINK_MONITOR_OnExit(void) {
app_timer_resume();
}

void JLINK_MONITOR_OnEnter(void) {
app_timer_pause();
}

void JLINK_MONITOR_OnPoll(void) {
MAIN_MonCnt++;

if(NRF_WDT->RUNSTATUS)
{
NRF_WDT->RR[1] = 0x6E524635UL;
}
}

void app_timer_pause(void)
{
NRF_RTC1->TASKS_STOP = 1;
NRF_RTC1->
}

void app_timer_resume(void)
{
NRF_RTC1->TASKS_START = 1;
}

Parents
  • I am able to debug as expected so far but need to be able to setup the project to work with jlink monitor mode - as I don't want hard faults.

    I hope I can do this with SDK13 and ANT+ s332 soft device!

    I've not tested the ANT SoftDevices with MMD, but I don't know of any reason why it would change the way we use MMD in any way. 

    The legacy app I am working on uses the app scheduler - can you give me any advice what I should be doing with the monitor functions to keep the softdevice happy?

    First see Interrupt model and processor availability and especially Interrupt priority levels

    MMD works by blocking execution of any priority below the MMD IRQ priority, so select one with care. 

    An MMD interrupt priority of 5 is safe, but any application code running at 2 or 3 will be able to preemt the MMD ISR and execute their code. 

    It is safe to run MMD at 2 and 3 as long as there's no ongoing flash operations or SD API calls.


    I'm not sure what the app_scheduler needs, it seems to run in mains context so it should be halted, if not there are the app_sched_pause and app_sched_resume functions. 

  • Hello Haakonsh

    I am looking into the pause and resume now for the scheduler

    in the meantime is it possible for me to get a SES project based on SDK13 and ANT+ s332 4.0.5 ?

    I have already tried using IAR based example in the SDK13 multiprotocol example but it keeps hanging when trying to list the services in the nrf tools app or other tools.

    I also tried importing this SDK13 demo project into SES - again it advertises but still hangs in the same place. Maybe it needs the s332 4.0.2 which is not readily available on theisant.com website? SDK14.X multiprotocol demos also do not work in the same way. SDK16/17 demos do work well.

    If I had a working SDK13 / ANT+ s332 4.0.5 demo I could be confident and proceed more myself.

    Also - what is the future of the softdevices - particularly around the ANT+/BLE - what is going to migrate to west/zephyr? 

  • adam watson said:
    in the meantime is it possible for me to get a SES project based on SDK13 and ANT+ s332 4.0.5 ?

     We do not have any support for SES in SDK13. Why do you need to use SDK 13 at all? 

    adam watson said:
    Maybe it needs the s332 4.0.2 which is not readily available on theisant.com website?

     Have you talked to Dynastream? 


Reply Children
Related