MAX32630FTHR BLE error

Hi,

I am very new to this platform and IDE. I would like to use the BLEHeartRateMon on my MAX32630FTHR MCU and tried adding the BLE_API library onto Mbed Studio. However when I tried compiling I get all sorts of errors below. Am I missing any additional libraries or using an imcompatible version? I am using version mbed-os 5.14.2. Appreciate any help!

[ERROR] .\source\main.cpp:19:10: fatal error: ‘ble/BLE.h’ file not found

Thanks,
Ricky

1 Like

Do you have an mbed_app.json file for your project? This is required. Here is a standard one found on the armmbed github repository. Note that it does not include your board.

So you could try adding your board. You may also need to make further mods to your target configuration to get it to work.

I think the reason may be due to the mbed-os don’t support BLE feature. I can compile the source code in the online complier. I find that the online complier include BLE feature in the mbed-os.

Thanks,
Ricky

Sorry my error.

For some reason I thought you were using the latest MAX32680 microcontroller rather than the MAX32630.

It is worth searching through the forum as there is plenty (the good, bad & ugly) about the MAX32630FTHR.

If that link is TL;DR, then basically the BLE module on max32630fthr micro is a peripheral device and thus requires TI specific CC256x HCI commands to get it to work with the micro. There is no longer an API within Mbed OS 6 to bridge this with the cordio stack.

I disable the BLE and use the printf to debug.
printf(“%02x:”, hrmCounter);

However, I don’t know how to see the data. I add the following code.
“*”: {

        "platform.stdio-baud-rate": 115200,

        "platform.stdio-buffered-serial": 1

    },

and I use uart 2 TX pin to output the data to PC. I set the baudrate to 115200, but nothing can be seen.

Thanks,
Ricky

The answer is revealed in the PinNames.h file found in the MbedOS targets folder for the Maxim MAX32639FTHR board.

There are two #defines for CONSOLE_TX & CONSOLE_RX

These point to UART0.

So, you would either need to redirect these to UART2 via mbed_app.json file, for example, or you could create a new BufferedSerial object for uart2, which then no longer needs those platform.stdio… defines/overrides in the mbed_app.json file.

I have change the tx and rx to uart0, but there is still nothing to see in the uart terminal. And other question is I want add some breakpoint in the program during debug mode, but I cannot find where to place the breakpoint.

Thanks,
Ricky

I keep forgetting that with the max32630fthr everything seems to be unique to that board.

I’ve had to consult the max32630fthr pinout diagram on the hardware page to see what is going on.

https://os.mbed.com/platforms/MAX32630FTHR/

OK, so it looks UART0 connects the max32630fthr with the PAN1326B BLE module, so it cannot be used.

That leaves UART2 as the only option via the standard pins.

I also see that the DAPLink connection has USBRX and USBTX broken out, which is also generally used to handle printf.

In that case if you have your max3265pico debugger connected you should see the serial printf outputs.

I dusted off all the cobwebs from my max32630fthr board and tested this using the blinky-baremetal example on mbed studio and I received the serial output directly in the console. So it works.

I can use UART0 to get the debug message. After I start the program, the uart terminal display the following error message,

++ MbedOS Error Info ++
Error Status: 0x80010133 Code: 307 Module: 1
Error Message: Mutex: 0x0, Parameter error
Location: 0xA3A1
Error Value: 0x0
Current Thread: main Id: 0x200046EC Entry: 0x75BD StackSize: 0x1000 StackMem: 0x200020E0 SP: 0x2007FF44
For more info, visit: mbedos-error
– MbedOS Error Info –

Thanks,
Ricky

1 Like

Hi there,

I (at least) get same error if you try to program MAX32630FTHR with any mbed OS version newer than 6.9.0.

There is something really wrong with UART 2 bus on this board. I cannot get my very simple ESP8266 based WiFi module to work on this board using mbed examples.

I really hope the problems with this board gets solved (though highly unlikely). Such an intresting peace of heardware, yet so troubled here on Mbed.

Why does it feel like Maxim Integrated has abandoned their product on Mbed?

Regards,
Danial

This issue was reported on github and it also mentions the same last functional version as you mentioned.

BR, Jan

1 Like

Hi,

Glad to see the issue is brought up there as well.

Regards,
Danial

If you can, it is best to use the bare metal profile.

Regarding printf redirect to UART2, the only way I could get this to work was to change the “PinNames.h” file directly where I changed

    // USB bridge connected UART pins
    CONSOLE_TX = P3_1,
    CONSOLE_RX = P3_0,

What I cannot figure out is that based on this link: Hitchhiker's Guide to Printf in Mbed 6

You should be able to override the console using

FileHandle *mbed_override_console(int fd)
	{
	    static BufferedSerial console(USBTX, USBRX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
		return &console;
	}

But this did not work.

Then I tried to add in a config statement within mbed_app.json for “stdio_uart_tx” and “stdio_uart_rx” as targets.json informs us that:

            "stdio_uart_tx": {
                "help": "default TX STDIO pins is defined in PinNames.h file, but it can be overridden"
            },
            "stdio_uart_rx": {
                "help": "default RX STDIO pins is defined in PinNames.h file, but it can be overridden"
            },

But this too did not work.

thank you buddy, i really like your reply this is really helpful for me

thank you buddy ..

1 Like