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:

GitHub - ARMmbed/mbed-cli-windows-installer: Windows installer for mbed CLI

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

I tried to compile with 5.8.6

➜  HSP_BULLS mbed compile -v
[mbed] Working path "/home/arturo/MbedPrograms/HSP_BULLS" (program)
[mbed] Exec "/usr/bin/python3 -u /home/arturo/MbedPrograms/HSP_BULLS/mbed-os/tools/make.py -t GCC_ARM -m MAX32620HSP --source . --build ./BUILD/MAX32620HSP/GCC_ARM -v" in "/home/arturo/MbedPrograms/HSP_BULLS"
Building project HSP_BULLS (MAX32620HSP, GCC_ARM)
Scan: .
Scan: env
Scan: mbed
Scan: FEATURE_BLE
[DEBUG] Macros: -DDEVICE_INTERRUPTIN=1 -DDEVICE_PORTIN=1 -DTARGET_M4 -DTARGET_RTOS_M4_M7 -DTARGET_CORTEX -DDEVICE_SERIAL_FC=1 -DTARGET_LIKE_MBED -DDEVICE_PWMOUT=1 -D__CMSIS_RTOS -DFEATURE_BLE=1 -DTARGET_MAX32620 -DTARGET_CORTEX_M -DMBED_BUILD_TIMESTAMP=1597552148.4014387 -DDEVICE_ANALOGIN=1 -DDEVICE_PORTINOUT=1 -DDEVICE_PORTOUT=1 -DDEVICE_SLEEP=1 -DDEVICE_SPI=1 -D__CORTEX_M4 -DTOOLCHAIN_GCC -D__FPU_PRESENT=1 -DDEVICE_I2C=1 -DTARGET_LIKE_CORTEX_M4 -DTARGET_Maxim -DDEVICE_SERIAL=1 -DDEVICE_SPI_ASYNCH=1 -DTARGET_RELEASE -DDEVICE_RTC=1 -DTARGET_MAX32620HSP -DDEVICE_STDIO_MESSAGES=1 -D__MBED__=1 -DTOOLCHAIN_object -D__MBED_CMSIS_RTOS_CM -DDEVICE_LOWPOWERTIMER=1 -DTARGET_UVISOR_UNSUPPORTED -DARM_MATH_CM4 -DTOOLCHAIN_GCC_ARM
Compile [100.0%]: main.cpp
[DEBUG] Compile: /opt/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ -std=gnu++98 -fno-rtti -Wvla -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -Os -g1 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -DDEVICE_INTERRUPTIN=1 -DDEVICE_PORTIN=1 -DTARGET_M4 -DTARGET_RTOS_M4_M7 -DTARGET_CORTEX -DDEVICE_SERIAL_FC=1 -DTARGET_LIKE_MBED -DDEVICE_PWMOUT=1 -D__CMSIS_RTOS -DFEATURE_BLE=1 -DTARGET_MAX32620 -DTARGET_CORTEX_M -DMBED_BUILD_TIMESTAMP=1597552148.4014387 -DDEVICE_ANALOGIN=1 -DDEVICE_PORTINOUT=1 -DDEVICE_PORTOUT=1 -DDEVICE_SLEEP=1 -DDEVICE_SPI=1 -D__CORTEX_M4 -DTOOLCHAIN_GCC -D__FPU_PRESENT=1 -DDEVICE_I2C=1 -DTARGET_LIKE_CORTEX_M4 -DTARGET_Maxim -DDEVICE_SERIAL=1 -DDEVICE_SPI_ASYNCH=1 -DTARGET_RELEASE -DDEVICE_RTC=1 -DTARGET_MAX32620HSP -DDEVICE_STDIO_MESSAGES=1 -D__MBED__=1 -DTOOLCHAIN_object -D__MBED_CMSIS_RTOS_CM -DDEVICE_LOWPOWERTIMER=1 -DTARGET_UVISOR_UNSUPPORTED -DARM_MATH_CM4 -DTOOLCHAIN_GCC_ARM @./BUILD/MAX32620HSP/GCC_ARM/.includes_bd158058f6d0a8e4df74cab1835b45b4.txt -include ./BUILD/MAX32620HSP/GCC_ARM/mbed_config.h -MD -MF BUILD/MAX32620HSP/GCC_ARM/HSP/main.d -o BUILD/MAX32620HSP/GCC_ARM/HSP/main.o ./HSP/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@115,12: 'BLE ble' redeclared as different kind of entity
[Error] main.cpp@118,19: expected primary-expression before ')' token
[Error] main.cpp@176,27: expected primary-expression before ')' token
[Error] main.cpp@275,10: expected primary-expression before '.' token
[DEBUG] Return: 1
[DEBUG] Output: In file included from ./USBDevice/USBDevice/USBHAL.h:24,
[DEBUG] Output:                  from ./USBDevice/USBDevice/USBDevice.h:24,
[DEBUG] Output:                  from ./USBDevice/USBSerial/USBCDC.h:27,
[DEBUG] Output:                  from ./USBDevice/USBSerial/USBSerial.h:22,
[DEBUG] Output:                  from ./HSP/main.cpp:39:
[DEBUG] Output: ./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]
[DEBUG] Output:    23 | #warning toolchain.h has been replaced by mbed_toolchain.h, please update to mbed_toolchain.h [since mbed-os-5.3]
[DEBUG] Output:       |  ^~~~~~~
[DEBUG] Output: In file included from ./HSP/main.cpp:39:
[DEBUG] Output: ./USBDevice/USBSerial/USBSerial.h: In constructor 'USBSerial::USBSerial(uint16_t, uint16_t, uint16_t, bool)':
[DEBUG] Output: ./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]
[DEBUG] Output:    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){
[DEBUG] Output:       |                                                                                                                                                                                                           ^
[DEBUG] Output: In file included from ./mbed-os/drivers/SPI.h:32,
[DEBUG] Output:                  from ./mbed-os/mbed.h:81,
[DEBUG] Output:                  from ./HSP/main.cpp:34:
[DEBUG] Output: ./mbed-os/platform/FunctionPointer.h:70:5: note: declared here
[DEBUG] Output:    70 |     FunctionPointerArg1(R (*function)() = 0)
[DEBUG] Output:       |     ^~~~~~~~~~~~~~~~~~~
[DEBUG] Output: In file included from ./HSP/main.cpp:39:
[DEBUG] Output: ./USBDevice/USBSerial/USBSerial.h: In member function 'void USBSerial::attach(void (*)())':
[DEBUG] Output: ./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]
[DEBUG] Output:   134 |             rx.attach(fptr);
[DEBUG] Output:       |                           ^
[DEBUG] Output: In file included from ./mbed-os/rtos/Thread.h:29,
[DEBUG] Output:                  from ./mbed-os/rtos/rtos.h:30,
[DEBUG] Output:                  from ./mbed-os/mbed.h:37,
[DEBUG] Output:                  from ./HSP/main.cpp:34:
[DEBUG] Output: ./mbed-os/platform/Callback.h:273:10: note: declared here
[DEBUG] Output:   273 |     void attach(R (*func)()) {
[DEBUG] Output:       |          ^~~~~~
[DEBUG] Output: In file included from ./HSP/System/Peripherals.h:46,
[DEBUG] Output:                  from ./HSP/main.cpp:42:
[DEBUG] Output: ./mbed-os/features/FEATURE_BLE/ble/BLE.h: In member function 'ble_error_t BLE::disconnect(Gap::DisconnectionReason_t)':
[DEBUG] Output: ./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]
[DEBUG] Output:  1049 |         return gap().disconnect(reason);
[DEBUG] Output:       |                                       ^
[DEBUG] Output: In file included from ./mbed-os/features/FEATURE_BLE/ble/BLE.h:21,
[DEBUG] Output:                  from ./HSP/System/Peripherals.h:46,
[DEBUG] Output:                  from ./HSP/main.cpp:42:
[DEBUG] Output: ./mbed-os/features/FEATURE_BLE/ble/Gap.h:1052:25: note: declared here
[DEBUG] Output:  1052 |     virtual ble_error_t disconnect(DisconnectionReason_t reason) {
[DEBUG] Output:       |                         ^~~~~~~~~~
[DEBUG] Output: ./HSP/main.cpp: At global scope:
[DEBUG] Output: ./HSP/main.cpp:115:12: error: 'BLE ble' redeclared as different kind of entity
[DEBUG] Output:   115 | static BLE ble;
[DEBUG] Output:       |            ^~~
[DEBUG] Output: In file included from ./mbed-os/features/FEATURE_BLE/ble/BLETypes.h:23,
[DEBUG] Output:                  from ./mbed-os/features/FEATURE_BLE/ble/Gap.h:20,
[DEBUG] Output:                  from ./mbed-os/features/FEATURE_BLE/ble/BLE.h:21,
[DEBUG] Output:                  from ./HSP/System/Peripherals.h:46,
[DEBUG] Output:                  from ./HSP/main.cpp:42:
[DEBUG] Output: ./mbed-os/features/FEATURE_BLE/ble/SafeEnum.h:23:11: note: previous declaration 'namespace ble { }'
[DEBUG] Output:    23 | namespace ble {
[DEBUG] Output:       |           ^~~
[DEBUG] Output: ./HSP/main.cpp:118:19: error: expected primary-expression before ')' token
[DEBUG] Output:   118 | HspBLE hspBLE(&ble);
[DEBUG] Output:       |                   ^
[DEBUG] Output: ./HSP/main.cpp: In function 'int main()':
[DEBUG] Output: ./HSP/main.cpp:176:27: error: expected primary-expression before ')' token
[DEBUG] Output:   176 |   Peripherals::setBLE(&ble);
[DEBUG] Output:       |                           ^
[DEBUG] Output: ./HSP/main.cpp:275:10: error: expected primary-expression before '.' token
[DEBUG] Output:   275 |       ble.waitForEvent();
[DEBUG] Output:       |          ^
Traceback (most recent call last):
  File "/home/arturo/MbedPrograms/HSP_BULLS/mbed-os/tools/make.py", line 282, in <module>
    bin_file = build_project(test.source_dir, build_dir, mcu, toolchain,
  File "/home/arturo/MbedPrograms/HSP_BULLS/mbed-os/tools/build_api.py", line 590, in build_project
    objects = toolchain.compile_sources(resources, resources.inc_dirs)
  File "/home/arturo/MbedPrograms/HSP_BULLS/mbed-os/tools/toolchains/__init__.py", line 977, in compile_sources
    return self.compile_seq(queue, objects)
  File "/home/arturo/MbedPrograms/HSP_BULLS/mbed-os/tools/toolchains/__init__.py", line 988, in compile_seq
    self.compile_output([
  File "/home/arturo/MbedPrograms/HSP_BULLS/mbed-os/tools/toolchains/__init__.py", line 1145, in compile_output
    raise ToolException(_stderr)
tools.utils.ToolException: 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:39:
./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:39:
./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:34:
./mbed-os/platform/FunctionPointer.h:70:5: note: declared here
   70 |     FunctionPointerArg1(R (*function)() = 0)
      |     ^~~~~~~~~~~~~~~~~~~
In file included from ./HSP/main.cpp:39:
./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:34:
./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:42:
./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:42:
./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:115:12: error: 'BLE ble' redeclared as different kind of entity
  115 | 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:42:
./mbed-os/features/FEATURE_BLE/ble/SafeEnum.h:23:11: note: previous declaration 'namespace ble { }'
   23 | namespace ble {
      |           ^~~
./HSP/main.cpp:118:19: error: expected primary-expression before ')' token
  118 | HspBLE hspBLE(&ble);
      |                   ^
./HSP/main.cpp: In function 'int main()':
./HSP/main.cpp:176:27: error: expected primary-expression before ')' token
  176 |   Peripherals::setBLE(&ble);
      |                           ^
./HSP/main.cpp:275:10: error: expected primary-expression before '.' token
  275 |       ble.waitForEvent();
      |          ^

[mbed] ERROR: "/usr/bin/python3" returned error.
       Code: 1
       Path: "/home/arturo/MbedPrograms/HSP_BULLS"
       Command: "/usr/bin/python3 -u /home/arturo/MbedPrograms/HSP_BULLS/mbed-os/tools/make.py -t GCC_ARM -m MAX32620HSP --source . --build ./BUILD/MAX32620HSP/GCC_ARM -v"
---

I tried to go further versions but I got the same result.

HI Arturo,

as none of this is supported all you can do is try earlier versions , so 5.8.5, 5.8.4 , 5.8.3 etc and keep going backwards until you find one that works. If you can’t find one that does then your only other options at this point are:

  1. Try and fix it locally yourself
  2. Use an alternative board

It may even be that this was never made to work on this board unfortunately…
Regards
Anna