Closed Ircama closed 1 year ago
I think that the puts undefined symbol is because of how u_printf()
is implemented.
In fact, editing UART_PRINT_DEBUG_ENABLE
to 1
removes the warning because a UART debug function becomes enabled.
./SDK/tools/linux/tc32/bin/tc32-elf-nm -u ./out/ATC_Thermometer.elf
U hci_rx_fifo
U hci_tx_fifo
I don't think that enabling this is appropriate (maybe useless) and anyway u_printf()
might not be used at all, so the puts
undefined symbol could be possibly ignored (or u_printf()
can be modified not to call puts()
if UART_PRINT_DEBUG_ENABLE
is disabled).
Output:
U hci_rx_fifo U hci_tx_fifo U puts
Because they are so declared in blob libraries, but are not used in the current program. To fix it, you need to rebuild liblt_8258.a, but the manufacturer does not provide the source codes of the BLE stack. This is how it is accepted in modern society, without any obvious restrictions. Like a fashion movement :)
Because they are so declared in blob libraries, but are not used in the current program.
Thanks, good to know they are unused and that the warnings can be ignored.
The Telink SIG Mesh SDK Developer Handbook mentions that "hci_tx_fifo and hci_rx_fifo are fifos to define and transmit data by peripherals, e.g., gateway nodes and gateway firmware USB communication".
There is an example of the definition of hci_rx_fifo and hci_tx_fifo in the Ai-Thinker-Open/Telink_825X_SDK repository.
The warnings disappear if we put that code in app.c, or alternatively if we just put
my_fifo_t hci_rx_fifo;
my_fifo_t hci_tx_fifo;
But this is at the cost of slightly increasing the size of the executable and slightly reducing the free RAM.
The program that outputs these "warnings" was written by me, purely to increase information. In reality, with a normal build, you will never see these "warnings". Moreover, it is not necessary to designate the type of these variables. The linker is looking for just a name. You can point to an empty space, to an address to nowhere. If this variable was used, the linker could not create the project = returned an error. There are hundreds of "Undefined symbols" in many projects. This suggests that they are incorrectly described in the library.
Enter in boot.link:
PROVIDE(hci_rx_fifo = .);
PROVIDE(hci_tx_fifo = .);
Want to get more "Warnings" - add an option to the makefile for 'GCC_FLAGS' -pedantic :)
I performed the following commands to compile the firmware using Ubuntu or WSL:
The output includes three undefined symbols.
In fact, when running
python3 ./src/TlsrMemInfo.py -t ./SDK/tools/linux/tc32/bin/tc32-elf-nm ./out/ATC_T hermometer.elf
I get:When performing the nm on ATC_Thermometer.elf I get the same three undefined symbols:
Output:
The first two look external references required by liblt_8258.a and liblt_8258_rtos.a, while puts might be needed by print.
Why does this happen?
Should we ignore these warnings?