Sifive Freedom E SDK build issue

Hello,
there is possibly an issue with the Sifive Freedom E SDK, please see:

.pio/build/sparkfun_thing_plus_v/src/main.o: in function .L0 ': main.cpp:(.text.startup.main+0x14): undefined reference to metal_gpio_get_device(unsigned int)’

The source code metal files, like gpio.c are not visible in the linker. This function is the only one that is not inline’d. In the examples provided by the PlatformIO functions that are used are only the one that also are inline’d.
The target board is the sparkfun_thing_plus_v. The PlatformIO is in the newest version.
Kind Regards,

When your C++ code interacts with the C code, did you make sure to include the C-code function definitions / header files with a extern "C" prefix? Complete code maybe?

thanks for the tip. I honesty thought this was performed in the re-packaging process (Freedom E SDK --> PlatformIO).
The code compilers but on the startup Jlink console shows this error now:
ATE0–>Send Flag Timed Out Busy. Giving Up.
Send Flag error: #0 #0 #0 #0 AT+BLEINIT=0–>Send Flag Timed Out Busy. Giving Up.
Send Flag error: #0 #0 #0 #0 AT+CWMODE=0–>Send Flag Timed Out Busy. Giving Up.
Send Flag error: #0 #0 #0 #0

I can imagine it is kind of exception / error form the low level startup code, I have doubts it is because mixing c and cpp code. What can it be: low level startup code / Jlink / ?

Pretty sure PlatformIO packages the verbatim SDK. Also the given example uses .c files and no C++.

“AT+BLEINIT”? What are AT commands for a bluetooth modem doing there in JLink output o_O?

What’s your full platformio.ini and hardware connections (from JLink to Board, or is that included on the board?)

the board has Jlink included. In the PlatformIO following connections are visible:

— Available ports:
— 1: /dev/ttyACM0 ‘J-Link - CDC’
— 2: /dev/ttyACM1 ‘J-Link - CDC’

the error is printed if the 1st device is selected. I try to measure someting and for me before this message is printed

ATE0–>Send Flag Timed Out Busy. Giving Up.
Send Flag error: #0 #0 #0 #0 AT+BLEINIT=0–>Send Flag Timed Out Busy. Giving Up.
Send Flag error: #0 #0 #0 #0 AT+CWMODE=0–>Send Flag Timed Out Busy. Giving Up.
Send Flag error: #0 #0 #0 #0

the device makes some resets, power fluctuation. The devices is powered from the PC USB port

I don’t know whether it’s correct that both channels (I’ve never seen one J-Link with 2 channels?! :open_mouth: ) are in CDC / USB-UART adapter mode. Normally they are loaded with libUSB drivers via Zadig and are interacted with via openocd or JLink.exe.

The board definition says that jlink is the default upload method

And yeah definitely JLink CLI is invoked here

So first please make sure you have the drivers installed per J-LINK — PlatformIO latest documentation.

You can also try to use https://zadig.akeo.ie/ and load libWin32Usb or libUSB drivers onto the JLink and see if that changes anything in the upload? (Required for ESP32, see ESP32 + J-link debugger does not start - #27 by manuelbl)

Oh well actually 3 Related questions about how FE310 works vs. other MCUs - #3 by TaLucGiaHoang - HiFive1 Rev B - SiFive Forums says that it might be a power problem, so try that first.

1 Like