Arm Mbed OS support forum

MAX32620HSP compiling error Ble variable re-declared

I am using the last mbed supported version wich is mbed-5.8.6.
I imported HSP_RPC_GUI program. When I compile It throws an error related with BLE ble declaration, here you can see:

mbed compile -t GCC_ARM
[mbed] Working path "/home/arturo/HSP_RPC_GUI" (program)
Building project HSP_RPC_GUI (MAX32620HSP, GCC_ARM)
Scan: .
Scan: env
Scan: mbed
Scan: FEATURE_BLE
Compile [100.0%]: main.cpp
[Warning] toolchain.h@23,2: #warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3] [-Wcpp]
[Warning] USBSerial.h@59,203: 'mbed::FunctionPointerArg1<R, void>::FunctionPointerArg1(R (*)()) [with R = void]' is deprecated: FunctionPointer has been replaced by Callback<void()> [since mbed-os-5.1] [-Wdeprecated-declarations]
[Warning] USBSerial.h@134,27: 'void mbed::Callback<R()>::attach(R (*)()) [with R = void]' is deprecated: Replaced by simple assignment 'Callback cb = func [since mbed-os-5.4] [-Wdeprecated-declarations]
[Warning] BLE.h@1049,39: 'virtual ble_error_t Gap::disconnect(Gap::DisconnectionReason_t)' is deprecated: Use disconnect(Handle_t, DisconnectionReason_t) instead. [-Wdeprecated-declarations]
[Error] main.cpp@113,12: 'BLE ble' redeclared as different kind of entity
[Error] main.cpp@116,19: expected primary-expression before ')' token
[Error] main.cpp@173,27: expected primary-expression before ')' token
[Error] main.cpp@270,10: expected primary-expression before '.' token
[ERROR] In file included from ./USBDevice/USBDevice/USBHAL.h:24,
             from ./USBDevice/USBDevice/USBDevice.h:24,
             from ./USBDevice/USBSerial/USBCDC.h:27,
             from ./USBDevice/USBSerial/USBSerial.h:22,
             from ./HSP/main.cpp:38:
./mbed-os/platform/toolchain.h:23:2: warning: #warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3] [-Wcpp]
   23 | #warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3]
  |  ^~~~~~~
In file included from ./HSP/main.cpp:38:
./USBDevice/USBSerial/USBSerial.h: In constructor 'USBSerial::USBSerial(uint16_t, uint16_t, uint16_t, bool)':
./USBDevice/USBSerial/USBSerial.h:59:203: warning: 'mbed::FunctionPointerArg1<R, void>::FunctionPointerArg1(R (*)()) [with R = void]' is deprecated: FunctionPointer has been replaced by Callback<void()> [since mbed-os-5.1] [-Wdeprecated-declarations]
   59 |     USBSerial(uint16_t vendor_id = 0x1f00, uint16_t product_id = 0x2012, uint16_t product_release = 0x0001, bool connect_blocking = true): USBCDC(vendor_id, product_id, product_release, connect_blocking){
  |                                                                                                                                                                                                           ^
In file included from ./mbed-os/drivers/SPI.h:32,
             from ./mbed-os/mbed.h:81,
             from ./HSP/main.cpp:33:
./mbed-os/platform/FunctionPointer.h:70:5: note: declared here
   70 |     FunctionPointerArg1(R (*function)() = 0)
  |     ^~~~~~~~~~~~~~~~~~~
In file included from ./HSP/main.cpp:38:
./USBDevice/USBSerial/USBSerial.h: In member function 'void USBSerial::attach(void (*)())':
./USBDevice/USBSerial/USBSerial.h:134:27: warning: 'void mbed::Callback<R()>::attach(R (*)()) [with R = void]' is deprecated: Replaced by simple assignment 'Callback cb = func [since mbed-os-5.4] [-Wdeprecated-declarations]
  134 |             rx.attach(fptr);
  |                           ^
In file included from ./mbed-os/rtos/Thread.h:29,
             from ./mbed-os/rtos/rtos.h:30,
             from ./mbed-os/mbed.h:37,
             from ./HSP/main.cpp:33:
./mbed-os/platform/Callback.h:273:10: note: declared here
  273 |     void attach(R (*func)()) {
  |          ^~~~~~
In file included from ./HSP/System/Peripherals.h:46,
             from ./HSP/main.cpp:41:
./mbed-os/features/FEATURE_BLE/ble/BLE.h: In member function 'ble_error_t BLE::disconnect(Gap::DisconnectionReason_t)':
./mbed-os/features/FEATURE_BLE/ble/BLE.h:1049:39: warning: 'virtual ble_error_t Gap::disconnect(Gap::DisconnectionReason_t)' is deprecated: Use disconnect(Handle_t, DisconnectionReason_t) instead. [-Wdeprecated-declarations]
 1049 |         return gap().disconnect(reason);
  |                                       ^
In file included from ./mbed-os/features/FEATURE_BLE/ble/BLE.h:21,
             from ./HSP/System/Peripherals.h:46,
             from ./HSP/main.cpp:41:
./mbed-os/features/FEATURE_BLE/ble/Gap.h:1052:25: note: declared here
 1052 |     virtual ble_error_t disconnect(DisconnectionReason_t reason) {
  |                         ^~~~~~~~~~
./HSP/main.cpp: At global scope:
./HSP/main.cpp:113:12: error: 'BLE ble' redeclared as different kind of entity
  113 | static BLE ble;
  |            ^~~
In file included from ./mbed-os/features/FEATURE_BLE/ble/BLETypes.h:23,
             from ./mbed-os/features/FEATURE_BLE/ble/Gap.h:20,
             from ./mbed-os/features/FEATURE_BLE/ble/BLE.h:21,
             from ./HSP/System/Peripherals.h:46,
             from ./HSP/main.cpp:41:
./mbed-os/features/FEATURE_BLE/ble/SafeEnum.h:23:11: note: previous declaration 'namespace ble { }'
   23 | namespace ble {
  |           ^~~
./HSP/main.cpp:116:19: error: expected primary-expression before ')' token
  116 | HspBLE hspBLE(&ble);
  |                   ^
./HSP/main.cpp: In function 'int main()':
./HSP/main.cpp:173:27: error: expected primary-expression before ')' token
  173 |   Peripherals::setBLE(&ble);
  |                           ^
./HSP/main.cpp:270:10: error: expected primary-expression before '.' token
  270 |       ble.waitForEvent();
  |          ^

[mbed] ERROR: "/usr/bin/python3" returned error.
   Code: 1
   Path: "/home/arturo/HSP_RPC_GUI"
   Command: "/usr/bin/python3 -u /home/arturo/HSP_RPC_GUI/mbed-os/tools/make.py -t GCC_ARM -m MAX32620HSP --source . --build ./BUILD/MAX32620HSP/GCC_ARM"
   Tip: You could retry the last command with "-v" flag for verbose output
---

I tried to change the BLE variable name and the program compile with success but the board is not recognized by Maxim Health sensor platform.

Can somebody help me with this?

Hi,

what do you mean last Mbed supported version 5.8.6 ? This is an extremely old Mbed OS release . The latest Mbed OS is 6.1.0 (we are also supporting 5.15.4 as well). I would suggest in the first instance upgrading your version of Mbed OS and see if that fixes your issues.

Regards
Anna

I mean the last supported version for MAX32620HSP
You can see in my terminal screenshot and text below.

➜  mbed-os git:(35fa909641) mbed update mbed-os-6.1.0
    [mbed] Working path "/home/arturo/HSP_RPC_GUI/mbed-os" (library)
    [mbed] Program path "/home/arturo/HSP_RPC_GUI"
    [mbed] Updating library "mbed-os" to branch/tag "mbed-os-6.1.0"
    [mbed] Updating reference "mbed-os" -> "https://github.com/ARMmbed/mbed-os/#a6207cadad0acd1876f436dc6baeddf46c42af06"
    ➜  mbed-os git:(a6207cadad) 
                                                                                                                                                                                                                                             
➜  mbed-os git:(a6207cadad) 
                                                                                                                                                                                                                                             
➜  mbed-os git:(a6207cadad) 
                                                                                                                                                                                                                                             
➜  mbed-os git:(a6207cadad) 
➜  mbed-os git:(a6207cadad) cd ..
➜  HSP_RPC_GUI ls
BUILD  device  HSP  mbed-os  mbed-os.lib  mbed_settings.py  __pycache__  USBDevice  USBDevice.lib
➜  HSP_RPC_GUI mbed compile
[mbed] Working path "/home/arturo/HSP_RPC_GUI" (program)
argument -m/--mcu: MAX32620HSP is not a supported MCU. Supported MCUs are:
ADV_WISE_1510,         ADV_WISE_1570,         ARCH_MAX, 
ARCH_PRO,              ARDUINO_NANO33BLE,     ARM_CM3DS_MPS2, 
ARM_MPS2_M0,           ARM_MPS2_M0P,          ARM_MPS2_M3, 
ARM_MPS2_M4,           ARM_MPS2_M7,           ARM_MUSCA_B1, 
ARM_MUSCA_B1_NS,       CY8CKIT_062S2_43012,   CY8CKIT_062_BLE, 
CY8CKIT_062_WIFI_BT,   CY8CKIT_064B0S2_4343W, CY8CPROTO_062S3_4343W, 
CY8CPROTO_062_4343W,   CYSBSYSKIT_01,         CYW9P62S1_43012EVB_01, 
CYW9P62S1_43438EVB_01, DISCO_F413ZH,          DISCO_F429ZI, 
DISCO_F469NI,          DISCO_F746NG,          DISCO_F769NI, 
DISCO_H747I,           DISCO_H747I_CM4,       DISCO_H747I_CM7, 
DISCO_L072CZ_LRWAN1,   DISCO_L475VG_IOT01A,   DISCO_L476VG, 
DISCO_L496AG,          DISCO_L4R9I,           DISCO_L562QE, 
EFM32GG11_STK3701,     EFM32GG_STK3700,       EP_AGORA, 
EP_ATLAS,              EV_COG_AD3029LZ,       EV_COG_AD4050LZ, 
FF1705_L151CC,         FF_LPC546XX,           FVP_MPS2_M0, 
FVP_MPS2_M0P,          FVP_MPS2_M3,           FVP_MPS2_M4, 
FVP_MPS2_M7,           GD32_F307VG,           GD32_F450ZI, 
GR_LYCHEE,             HEXIWEAR,              K22F, 
K64F,                  K66F,                  K82F, 
KL25Z,                 KL43Z,                 KL46Z, 
KW41Z,                 LPC1114,               LPC1768, 
LPC54114,              LPC546XX,              MAX32600MBED, 
MAX32620FTHR,          MAX32625MBED,          MAX32625PICO, 
MAX32630FTHR,          MIMXRT1050_EVK,        MOTE_L152RC, 
MTS_DRAGONFLY_F411RE,  MTS_DRAGONFLY_F413RH,  MTS_DRAGONFLY_L471QG, 
MTS_MDOT_F411RE,       NRF52840_DK,           NRF52_DK, 
NUCLEO_F070RB,         NUCLEO_F072RB,         NUCLEO_F091RC, 
NUCLEO_F103RB,         NUCLEO_F207ZG,         NUCLEO_F303K8, 
NUCLEO_F303RE,         NUCLEO_F303ZE,         NUCLEO_F401RE, 
NUCLEO_F411RE,         NUCLEO_F412ZG,         NUCLEO_F413ZH, 
NUCLEO_F429ZI,         NUCLEO_F439ZI,         NUCLEO_F446RE, 
NUCLEO_F446ZE,         NUCLEO_F746ZG,         NUCLEO_F756ZG, 
NUCLEO_F767ZI,         NUCLEO_G071RB,         NUCLEO_G474RE, 
NUCLEO_H743ZI2,        NUCLEO_L073RZ,         NUCLEO_L152RE, 
NUCLEO_L432KC,         NUCLEO_L433RC_P,       NUCLEO_L452RE_P, 
NUCLEO_L476RG,         NUCLEO_L486RG,         NUCLEO_L496ZG, 
NUCLEO_L496ZG_P,       NUCLEO_L4R5ZI,         NUCLEO_L4R5ZI_P, 
NUCLEO_L552ZE_Q,       NUCLEO_WB55RG,         NUMAKER_IOT_M263A, 
NUMAKER_IOT_M487,      NUMAKER_M252KG,        NUMAKER_PFM_M453, 
NUMAKER_PFM_M487,      NUMAKER_PFM_NANO130,   NUMAKER_PFM_NUC472, 
RHOMBIO_L476DMW1K,     RZ_A1H,                S5JS100, 
SDP_K1,                SDT32620B,             SDT32625B, 
SDT52832B,             SDT64B,                TB_SENSE_12, 
TMPM46B,               TMPM4G9,               UHURU_RAVEN, 
WIO_3G,                WIO_BG96,              WIO_EMW3166, 
XDOT_L151CC            
[mbed] ERROR: "/usr/bin/python3" returned error.
       Code: 2
       Path: "/home/arturo/HSP_RPC_GUI"
       Command: "/usr/bin/python3 -u /home/arturo/HSP_RPC_GUI/mbed-os/tools/make.py -t GCC_ARM -m MAX32620HSP --source . --build ./BUILD/MAX32620HSP/GCC_ARM"
       Tip: You could retry the last command with "-v" flag for verbose output

Also, here is a reply email from Maxim

Dear Customer

Thank you for contacting Maxim’s technical support group!

This issue should be fixed by roll back mbed-os

I tried with online compiler, the “Reversion” seems not work.

Another way is to roll back with CLI by:
change to the mbed-os dir in your project
$ cd your_project/mbed-os
roll back mbed-os to tag: mbed-os-5.8.6
$ mbed update mbed-os-5.8.6

Here is the link of mbed CLI Windows Installer for your reference:

https://github.com/ARMmbed/mbed-cli-windows-installer

Thank you!
Best Regards
Miranda Zhang
Applications Engineer

HI Arturo,

I’ve double checked and yes you are correct, the last release that contained support for that Maxim target was indeed 5.8.6, support was removed immediately afterwards and has not been reinstated (so you won’t be able to use a later version). If you are having problems with 5.8.6 then all I can suggest is trying earlier versions than this ? If you still have issues then the best solution, if possible, would be to move to a currently supported board?

Sorry I can’t be more helpful.

Anna