I'm relatively new and have been using 52832 DK for several months without any problems. It is a great product. As I gained experience, I've tried programming other boards (GT52832_A01) using a mini J-Link that I bought from Adafruit - again without problems. All of the example programs load and run on both DK and GT boards as expected.
I recently bought a few MDBT42Q modules from Mouser (they are made by Seeed Studios). I believe this is the same module used by Adafruit on their Featherboard 52832, so I thought this would be a good product to expand my experience. I was able to program the MDBT42Q boards using the J-Link, however, when I try to use anything with BLE the program loads but I'm not able to connect to the board via BLE. I load the soft device loads and then the program the same way as with the DK and GT boards, except I'm not able to connect to the MDBT42Q board. It is as if the board isn't advertising.
I did a search in the DevZone and found one post by Sudarshan J 10 months ago that looked similar to my problem but I'm not sure how to proceed and hope you might suggest some things to try.
The datasheet for the MDBT42Q basically says that you don't need any external circuitry to make the module work, so it may not be a clock problem - but I'm not sure. Since the module works fine (I can load simple blinky programs and program gpio, etc), I think I'm missing something simple.
A related question - I tried to use debug to set breakpoints before and after the advertising function to try to see what was happening. I tried to go stepwise through the program but execution just stops - so I must be missing something there as well. There is a warning that there is a 32Kb limit on evaluation in debug - is that the problem? Any suggestions?
Thank you for your help.
JimP said:MDBT42Q modules from Mouser (they are made by Seeed Studios)
You mean these: https://www.mouser.co.uk/ProductDetail/Seeed-Studio/317030213?qs=sGAEpiMZZMs1xdPSgahjwiL2lJlP6L5V96Mk9IiRNC0%3d ?
JimP said:The datasheet for the MDBT42Q basically says that you don't need any external circuitry to make the module work, so it may not be a clock problem - but I'm not sure
Probably means that you have to configure it to use the internal oscillator - have you done that?
JimP said: I believe this is the same module used by Adafruit on their Featherboard 52832
Would be a good idea to get an Adafruit Featherboard 52832 - then you'd at least have a know-good hardware platform to start with ...
JimP said:There is a warning that there is a 32Kb limit on evaluation in debug
Are you using Keil, then?
Segger Embedded Studio (SES) is free & unlimited for use with Nordic ARM-based SOCs ...
Yes. I'm using the module you show in the link. Yes - I'm using Keil as IDE - supplemented with nRFgo studio.
I haven't configured to use internal oscillator. How would I do that?
The featherboard comes with Arduino IDE. There must be a way to convert for Keil but I don't know how to do that.
Thank you for your help
Essentially this is just a nRF52832 module, so I recommend you use the normal nRF5 SDK (latest is 15.2) instead of featherboard (or other) stuff. The module includes the 32 MHz crystal, but there is no 32 kHz crystal (optional). Note that the nRF SDK examples assume that the crystal is present, so you have to adapt the SoftDevice configuration to use the internal RC instead. Other than that, you should expect any SDK examples to work out of the box.
Thank you Einar. Based on you comment - In SDK_CONFIG - I set NRF_SDH_CLOCK_LF_SRC 0 //set to RC and NRF_SDH_CLOCK_LF_ACCURACY 1 // set tp 500 ppm - per waring
but still can't connect to the module. I must still be missing something. Any other suggestions?
Thanks for your help.
I'm having the same issue. Code runs and works well on the PCA10040 but I'd like to flash it to a MDBT42Q. I also tried switching to RC clock but it'd not working out.
Please post if you find a fix. Thanks!
etx said:I'm having the same issue.
How do you know it's the same issue?
What debugging have you done to find where the problem is ?
Have you programmed the SoftDevice?
Have you tested with an unmodified Nordic example?
I haven't tested this extensively but I'm now able to communicate with the MDBT42Q via BLE. It involved 2 steps.
1. you need to change the clock source in the ble_stack_init function (or wherever the soft device handler is located) as follows:
Use the debugger on SDK board instead of the mini JLink I have been using. I don't understand why this worked - but it did.
I made an 8 pin connector for the 8 pins next to the PCA10040. VDD and VTG are connected to SDK VDD 3.3 V supply. SWDIO connect to MDBT Module SWDIO (pin 37). SWDCLK to MDBT Module SWDCLK (Pin 36) and Reset to MDBT Module reset (Pin 35). SWO not connected. GND detect connected to common ground on both SDK board and Module. In my setup the module is connected to separate 3.3v supply with common ground. VDD nRF is not connected.
Since making those changes I've been able to load programs on the SDK board and test them and then connect the MDBT module (via the 8 pin connector) and load the same softdevice and program. The Module then runs the program the same as the SDK board.
I've tested the BLE_blinky program and that works on MDBT the same as the SDK board using nRF Blinky app on android phone.
JimP said:Use the debugger on SDK board instead of the mini JLink I have been using. I don't understand why this worked - but it did.
You'd need to take that up with Adafruit.
Thank you for bringing zero value to this thread.
I did everything the OP posted before I found this thread. That's why I posted to see if he had come up with anything.
If you're not going to be constructive and act like a neckbeard please just move along.
Thanks for posting, glad you got it going!
I'll double check my connections but the NRF52-DK seems to be flashing the MDBT42Q with the application and SD without any errors. I'm not connecting the reset pin, is that required?
You much be using an older SDK, I don't see that macro (SOFTDEVICE_HANDLER_INIT) in version 15 of the SDK which is what I'm using. But I have tried setting the equivalent defines in the sdk_config.h so it should equate to the same settings for the clock. Still no love... I'll keep trying.
I should add, like you the examples that don't use the SD work fine. Blinky for example runs fine as I made a board file for the MDBT42Q with proper pin configurations.
I had the exact same experience.
I'm using version 15 of SDK also. I've noticed a few differences in the code depending on the example you start with and where you get the example code. Some code has SOFT_DEVICE_HANDLER but not all.
I'm planning to test a few variations later today and will post exactly the version I start with, changes I make, and results.