This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

(Solved) Help with WGT51822-S2 module

Hi,

I have been developing using some development modules from WaveShare (based on the nRF51822 QFAC) and they work fine.

However, I'm now trying to use a module better suited small scale deployment, which I sourced from AliExpress

www.aliexpress.com/.../32486456702.html

And the module does not seem to work at all, after I upload exactly the same code as for the QFAC module.

I know the QFAA is 16k RAM and the QFAC is 32k, but I don't think this is the problem, because I tried loading a precompiled bootloader (from RedBearLab) for one of their products which uses the QFAA and I still do not get any advertising packets on BLE :-(

I know the module was originally working, as it came pre-flashed with some sort of BLE to Serial / AT command set firmware, and it was visible on BLE.

However after I erased the chip (using JFlash), and reflashed any other code, I can't get it to do anything.

Is there any other sort of master reset that I may need to do on this device apart from using Erase Chip in JFlash ? (Actually I tried using another GDB compatible SWD programmer and used the "monitor erase_mass" command, which normally totally erases the nRf51, but it didnt make any difference :-(

I guess I can go back to first principals and perhaps load a program that does virtually nothing except toggle a GPIO pin, and run it in the debugger.

But I was hoping there was perhaps something else I could try, before I have to configure GDB etc in Eclipse etc, as I don't have it configured to do on chip debugging at the moment.

Thanks

Edit.

I have since found the module is actually a Wireless-tag.com WGT51822-S2, and the problem is because it does not have a 32kHz crystal So I have changed the title as this is more accurate

  • Thanks

    It looks like the mbed file I'm using has been updated since I took snapshot (another long story)

    So it now appears to include a timeout on the startup check (which my file doesnt have)

    github.com/.../system_nrf51.c

    In fact, the newer version of the file has been refactored, and looks like it has other improvements

    I'll need to contact the original author of the code - who took the snapshot of the mbed cmsis and ask him whether he thinks I can just grab the latest cmsis from mbed or whether he made some changes

    I suspect he just took a snapshot, and copied the files rather than using the github submodule system

    But I won't be able to contact him until tomorrow as he is in Canada and they will be asleep by now

    Anyway, I think you have solved this mystery.

    Thanks

    Roger

  • A quick comment: If you are using a BLE example with a SoftDevice, and you need to change the 32k clock source, you need to change the following line in main.c:
    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);

    To use the internal 32k source change the clock parameter to something like this instead: NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_8000MS_CALIBRATION

  • @Torbjørn

    Yes.

    I'm using the S130 soft device from the Version 9 SDK

    I'll need to track down where in the code this is currently getting setup. I did a quick search through the codebase I'm using, (mostly from mbed) and I can't see anything like SOFTDEVICE_HANDLER_INIT

    Sorry if I seem vague about this,but I'm using a modified version of the RedBearLab's firmware for the Arduino IDE, as it compiles under GCC.

    And I'm not currently familiar with how the code is structured.

    I am however very familiar with embedded development as I am webmaster on www.stm32duino.com and host the Arduino_STM32 repo's on my github account.

  • I still have not managed to get these modules to work.

    However I have identified them as a Wireless-tag WT51822-S4AT, which is the same as the WT51822-S2 except comes preflashed with some AT command firmware, which i have erased

    www.wireless-tag.com/.../26.html

    I checked the mbed codebase I'm using and I changed the #define so that the module would use the RC oscillator, however it seemed to make no difference, and the module seems to fail to start up.

    Unfortunately I cant seem to find any example code for this module.

    Does anyone have any example code for Eclipse / Gcc for modules without the 32khz crystal

  • It should be possible to change the LF clock source in mbed, but I am not very familiar with the online mbed compiler and haven't been able to figure out where to change it... You can also download the official SDK, which has several BLE examples supporting Eclipse/GCC, and allow you to set the LF clock source to either external or internal (with calibration). The SDK can be downloaded here: developer.nordicsemi.com/.../

Related