Arm Mbed OS support forum

MAX32630FTHR and BLE?

Hi.
I’m new to this device, and to Mbed, so very likely I’m doing something wrong, but the BLE HR below example does not seem to work. Can anyone verify it actually works using that board ?

I have gotten some other examples working (like the PWM blinky and regular blinky).
Have tried using both the web-ide and Mbed studio.

https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-ble-HeartRate/

This post seems to confirm there are some issues, but even after applying the suggested fix it does not seem to work.

https://os.mbed.com/questions/78005/Using-MAX32630FTHR-PAN1326B-bluetooth-mo/

Just to confirm a few things. You are using the correct BLE examples?

Then have you modified the mbed_app.json file. From what I’ve seen, this does not include your board, so you’ll need to add it in.

{
    "target_overrides": {
        "K64F": {
            "target.components_add": ["BlueNRG_MS"],
            "target.features_add": ["BLE"],
            "target.extra_labels_add": ["CORDIO"]
        },
        "NUCLEO_F401RE": {
            "target.components_add": ["BlueNRG_MS"],
            "target.features_add": ["BLE"],
            "target.extra_labels_add": ["CORDIO"]
        },
        "NRF52840_DK": {
            "target.features_add": ["BLE"]
        },
        "NRF52_DK": {
            "target.features_add": ["BLE"]
        }
    }
}

Thanks!
What do you mean by “correct BLE” examples ? Is this the correct one ?
https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-ble-HeartRate/

But added this to the mbed_app.json file:
“MAX32630FTHR”: {
“target.features_add”: [“BLE”]
}

However, the program never seems to go past this line:
(in main.cpp)
_ble.init(this, &HeartrateDemo::on_init_complete);

Not exactly.

If you look on the right hand side of the heartrate example web page it gives you the Repository details. However, it only tells you when this example was created (i.e. 26 Jul 2016). What this page does not tell you is when it was last updated. For some reason you have to go back to the search results to see that vital piece of information. Here it tells you this example was last updated on 19 Sep 2019. It’s really aimed at MBED OS 5.

So, whether this example will work or not will actually depend on which MBED OS you are using. I know with MBED Studio it will update to MBED OS 6.2 and in this case it is better to use the code from the GitHub repository.

If you are still using MBED OS 5.x then you will be fine with what you are using.

Don’t worry all these issues about the out of date website etc. as these have been flagged… see the “Seriously disappointed” post.

Anyway, to help it is best to understand what OS version you are using.

Thanks for your help!
So newbie question, in this case I used the web-ide, how do I know what version of Mbed its using/targeting ?
I did use the Mbed-studio a couple of days ago, but also had the same problem.

I seems to be that the MAX32630FTHR is no longer a supported board (since its using a the PAN1326B chipset for BLE), is there a reason why it got dropped, or should I just get something else ?

I’m a little confused myself, but I believe the web-ide is still MBED OS5.

I seems to be that the MAX32630FTHR is no longer a supported board (since its using a the PAN1326B chipset for BLE), is there a reason why it got dropped, or should I just get something else ?

I’m not in a position to confirm, but based on the hardware listed on the MBED website you could easily make the assumption that it is compatible:

Thanks!
Yes, thats why I picked the board, and since I have a feather OLED (and a GPS feather wing) so I thought I could re-use some old HW but also go for Mbed (arduino is ok, just lacking in many things).
If anyone has gotten the MAX32630FTHR working, using Mbed studio or the web-ide please let me know, I think something happened along the way but it has just not been reported.
Like stated the workaround mentioned in my first post didn’t work, so something else probably changed too along the way.

Sorry, I had assumed that the Bluetooth was somehow integrated with the MAX32630FTHR, but now that I dug the datasheet out, I can see that the PAN1326B module (which in turn is a TI CC2564 controller) is merely treated as a peripheral with a serial interface.

image

In this case you do not use the MBED BLE API. Instead you’ll need to create your own code using the BufferedSerial / UnbufferedSerial (OS 6.2) or RawSerial /Serial (OS 5.15) drivers.

From what I can make out you need to go to TI.com to figure out how to use the Bluetooth module via UART interface (PCM/I2S is not connected).

https://www.ti.com/product/CC2564

EDIT: I think this is what you’ll need…

https://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands

Thanks!
But it seems like the PAN1326B had Mbed support at some point, is there a reason why support was removed ?
https://os.mbed.com/questions/78005/Using-MAX32630FTHR-PAN1326B-bluetooth-mo/

I have just used BLE (nRF52, esp32, in Arduino) from a higher API point of view, but will look into the Ti docs.

In the UK/Ireland there is an ad with a famous tag line “should’ve gone to Specsavers”.

In this case, it’s “should’ve gone to GitHub…”

A quick review of valid MBED BLE targets on Github repository confirms that Maxim is listed in MBED 5.15 (so your example should work in the online compiler):

But… not sure if you need to change library names etc. to get your example to work correct. Maybe others can confirm. Still worth a try.

EDIT:
I noticed that in the mbed_app.json file there is another attribute “target.extra_labels_add”

So maybe you will need to add this in for the Maxim board.

Suggest trying:

"target.features_add": ["BLE"],
"target.extra_labels_add": ["Maxim"]

Not sure about the component attribute.

Thanks for the help. Using the web-ide.
Still doesn’t work.
It eventually prints this (and then starts blinking),
but according to the BLE scanner there is no HRM service.

06:43:58.079 -> DEVICE MAC ADDRESS: 80:6f:b0:8d:50:98
06:43:58.079 -> _ble.gap().setAdvertisingParameters() failed

Since I have two boards, if you have interest maybe I could ship you one to test with ?
It seems like a quite capable board otherwise, but BLE is a requirement for the project I have in mind.

So after checking out code, and rgrep usage there does seem to be support.

BUILD/MAX32630FTHR/GCC_ARM/.profile-c: “BLE_HCI_UART”,
mbed-os/features/FEATURE_BLE/targets/TARGET_Maxim/MaximBLE.cpp:#ifdef BLE_HCI_UART

However, unfortunately I have been unable to run anything using the mbed cli, when copying the .bin to DAPLINK it never finishes, and it doesn’t run.
Only the web-ide binary works, but in there I can’t find the MaximBLE.cpp file ? (again, mbed newbie)

Thanks for the offer to send me a board. It’s an attractive offer, but before I take up the offer I have to ask you why this board.

Thought to put that question out there, as there are a couple of other BLE feather form factor boards on the market, which may be easier to use with MBED.

If you want to continue the Maxim BLE conversation privately then you are welcome DM me.

Regarding MBED web-ide, I think the best bet as a newbie is to get familiar with the basics first. Try out Blinky, then DIO then AIO, I2C bus etc.

Can’t figure out how to DM ?
Anyway, since I already have a Feather display and a Feather GPS module I figured I could re-use that hardware with this board (and its nice size wise).


Btw, this board does have Arduino support, but absolutely NO examples (most other boards do include examples).

Board also comes with Eclipse and Maxim’s own tools, but those also lack BLE examples.
In short, Maxim seems to have released the board in 2017, then stopped supporting it, sad.

Yes I too like Feather form factor. I sent you a DM.

@gerriko and @heikkij
The specs of the MAX32630FTHR are impressive even today, that is why i bought 4 of them about 2 years ago. Back then the old USB stack and also the BLE stack of mbed-os was fully functional on this board.
But as time elapsed and mbed-os evolved…well…features got broken one after the other on this board.

Really hope Maxim team and mbed-core team can soon bring support back to this board as currently this board is definately not mbed capable as stated on the mbed website.

Nothing like failure and problems to learn the ropes… and so it proved with this board. It’s helped me partly understand what goes on with mbed os 6.2.

So using Mbed Studio and Mbed OS 6.2.1, I found that the GPIO’s work, Interrupts work, I2C works, SPI works, UART works (although virtual serial does not), the BMI160 IMU sensor works (well sort of - just need to test with the Interrupt), the SD card did sort of work (need to test again as one SD crapped out so problems could’ve been card related). That just leaves the elephant in the room, the PAN1326 dual Bluetooth module, which only works on Mbed OS 5.ancient. I suspect the reason that it no longer works with OS 6.2 is because maxim do not believe in partnership and in supporting the changes required.

So, as you mentioned here and on your other post, 99% of issues could be attributable to the lack of official support by Maxim. A rather poor show, by Maxim, in my opinion.

This may be already discussed elsewhere, but it would be nice if there is a status matrix from the mbed-core team of what has actually been tested for every board that is listed as compatible, as the current state of this board has basically been abandoned.

gerriko found for instance the BLE on this board (in mbed 5) stopped working after Dec 14, 2018!!
(and even then there is ~10m time before it does anything)
Later revisions of code just fail with _ble.gap().setAdvertisingParameters() failed

I would for instance not had picked up this board if I knew it had so poor SW support
(arduino support/documentation is also lacking)

As for BLE there is a trick i described here. However in mbed-os V6.0.0 they just decided to remove BLE support on this board until maxim would implement it based on the Cordio stack.

As for what is tested on which board, well there are so called greentea test i wanted to get my hands dirty with. But the documentation is poor (yet again). I did everything as written in the docs and still i could not get greentea tests working. So you need to be an insider and know undocumented details.

I am sure they run tests before the releases but many bugs are simply not catched by the tests. Pair that up with the ever changing code base and extremely poor docs and you will understand why there so many open issues on any target.

Thank you, yes, I did find that post (see top of this thread), but the old thread seems closed so could not reply there directly.

However, since you have to wait approximately 10m before it does start working, obviously I never got that far! But any newer revision of the code does not work at all: I tried them all.

I’ll check out greentea when I have a chance.
Have you heard anything from Maxim why they don’t seem to support their boards ?