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

Events triggered in slave while not paired

Hi Nordic, I come from this question: devzone.nordicsemi.com/.../

So, my doubt is: what events are triggered in a slave channel while it is not communicating to a master?

I am having problems triggering EVENT_CHANNEL_CLOSED (the function sd_ant_channel_closed returns 0x00000, SUCESS, but the EVENT_CHANNEL_CLOSED never triggers) when an ANT channel is configured as slave and it is not communicating with any master (it didn't find any). I have also tried to get EVENT_RX_SEARCH_TIMEOUT and EVENT_RX_FAIL_GO_TO_SEARCH but they dont trigger either.

EDIT: I also realised that events related to sd_flash_write and sd_flash_erase (NRF_EVT_FLASH_OPERATION_SUCCESS or NRF_EVT_FLASH_OPERATION_ERROR, from sys evt dispatch function) don't trigger either when the slave has not found a master. Is this behaviour normal?

  • Hi again Petter!

    1. I check with the debugging tool, putting one breakpoint, only one. When I reach that breakpoint, I remove it and put it somewhere else, and reset the system to check again.

    2. To make sure I am not in a restart loop, after (and only after) starting my program I put a breakpoint in the beginning of the main(), making sure I don't go through that place again.

    3. If I put a breakpoint there I always reach it, err_code = 0x000000.

    4. I can't find app_error_fault_handler(). I put it in line 160 of arm_startup_nrf51.s (HardFault_Handler
      PROC EXPORT HardFault_Handler [WEAK] B .)

    5. I am using nrf51 DK. Laser markings: N51422QFACA11517AP (hopefully, maybe one changes, too small)

    I think I have a corrupt toolchain. After yesterday's trial of complete reinstallation it is giving some weird problems. Can you please tell me what version of everything you are using? And how to make a completely clean reinstallation of the whole toolchain. I tried to remove everything but keil was not completely uninstalled.

    PS: So, just to make sure, you are running the example I gave you under the name broadcast_tx (SLAVE in my case) and are getting these events to trigger? :(

    Thanks a lot!

  • Ok. Good.

    Strange. It seems that you are using packs? Can you try to download the zip from here instead, and see if that changes anything?

    Yes, I'm testing with your broadcast_tx, and they trigger.

  • I reinstalled the whole toolchain again and tried with that zip you told me: nRF51_SDK_10.0.0_dc26b5e.zip

    But still, the behaviour is the same :(. I'll write the steps I do:

    1. Reinstall Keil. I uninstall everything and remove all the files.
    2. I run the example inside the folder examples/ant/ant_broadcast/broadcast_tx
    3. Keil starts updating automatically, and downloads everything from his server, even the nordic components. This steps worries me, maybe the files keil downloads are not the correct ones? I didn't have to run nRF5x_MDK_8_2_0_Keil4.msi to get everything to compile.
    4. Start compiling and debugging. Everything is the same as before, no EVENTS.

    It's frustrating being stuck because of this :(

    EDIT:

    Finally I get some difference in my toolchain now. What I did: I reinstalled Keil, Installed nRF5x_MDK_8_2_0_Keil4.msi and then let Keil update itself.

    To test if this changes something, I tried to upload my code this time but I am getting the typical Error: Flash Download failed - "Cortex-M0" . Softdevice and Application are overlapping apparently. I have this settings: http://imgur.com/a/aH9pX

    EDIT2: Just changed this parameters to IROM1: 0xD000 0x33000, IRAM1: 0x20000900 0x7700 and managed to upload. Now, I just realised that I actually am in a kind of reset loop. When the event EVENT_RX_SEARCH_TIMEOUT, because when I change the values of sd_ant_channel_rx_search_timeout_set and sd_ant_channel_low_priority_rx_search_timeout_set, the time to go to reset changes as well. Any idea?

    Thanks a lot!

  • Are you running arm5_no_packs? If not use the project in \examples\ant\ant_broadcast\broadcast_tx\pca10028\arm5_no_packs If you open Select Software Packs, what are selected, it should be ARM::CMSIS 4.5.0 and nRF_DeviceFamilyPack 8.2.0. If not open Pack Installer and click the green arrows to check for update.

    I don't understand why your memory settings are reset, but you are setting them correctly. In my project MicroLIB is also checked, but that shouldn't matter.

    I didn't quite understand your last edit, are sd_ant_channel_rx_search_timeout_set() or sd_ant_channel_low_priority_rx_search_timeout_set() returning any error?

  • Yep, I am running that, arm5_no_packs. I will check those numbers later, dont have acces now to the system.

    No no, they return 0x00000, NRF_SUCCESS. The thing is that if I change the timeout time, to, say, 2,5 seconds for search_timeout_set and 2,5 seconds to low_priority_rx_search_timeout_set, the time that the microprocessor lasts in reset itself is 5 seconds, that is exactly when the event RX_SEARCH_TIMEOUT should have been triggered. If I change these numbers to, say. 10 seconds, the time until it goes to reset again is 10 seconds.... So weird that it only happens in my machine...

    Thanks!

Related