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

  • 1.The module you post from AliExpress, it seems no 32.768 crystal. Did you check it?

    2.The AC and AA need different build option, make sure you change to right one.

    image description

  • Which program did the screengrab come from?

    I'm building just using Make rather than using a GUI build (long story).

    I know that the AC and AA have different build settings, because of the difference in the size of RAM, but I was not aware of any other differences.

    In fact as far as I was aware my build target was set for 16k RAM

    I'm using this WaveShare development board which uses this module

    www.waveshare.com/.../core51822.htm, (actually I have 3 RF modules like this and they are all QFAC)

    Looking at the schematic, it has a 32KHz osc

    www.waveshare.com/.../Core51822-Schematic.pdf

    I don't have a schematic for the module from AliExpress, but I can only see what looks like the 16Mhz crystal and not a 32khz osc

    I'll need to look through my code (a lot of which came from mbed) to see if there is a dependency on the 32khz osc

  • Umm

    Looks like this may be the issue

    developer.mbed.org/.../

    i.e there is code which waits for both the 16Mhz and 32khz clocks to start but the 32khz without any form of timeout (in the mbed cmsis ) :-(

    There wasn't an answer to that question on the mbed forum, so I guess I'll need to manually work out what mbed uses the 32khz clock for and whether its necessary or whether there is a work around

    i.e is the 32khz clock normally essential ?

  • The program is MDK-ARM uVision V5.

  • I'm not familiar mbed, but if you don't have 32K crystal, you can set the clock source to 16M. I saw the link you posted, it might be help. NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);

    to..

    NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);

    or to..

    NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_SYNTH << CLOCK_LFCLKSRC_SRC_Pos);

    Maybe you can try it.

Related