Mercury API

miacompoot
Posts: 4
Joined: Sun Oct 25, 2020 2:13 am

Mercury API

Postby miacompoot » Sun Oct 25, 2020 2:24 am

Is it possible to implement/run/flash/ use (or any other possible wording) the thingMagic Mercury Api for RFID readers with the ESP32 microcontroller. if so, how does one go about setting up and testing this process. I ask this cause I have come a long way with trying to do just this. I learned how to use cmake and everything and at the point i am at it is not even clear what error i have again. When i run idf.py build it seems to be going smoothly till I encounter this issue "error adding symbols: file format not recognized collect2.exe: error: ld returned 1 exit status" Is there a known way to fix this.

Additionally, this github post:
https://github.com/micropython/micropython/issues/2181
Is worrying me, since it makes me think that the libraries the API needs/makes are simply not compatible with the microcontroller.

Any information is appreciated, and the more detailed the better,

Thanks so much

ESP_Sprite
Posts: 4108
Joined: Thu Nov 26, 2015 4:08 am

Re: Mercury API

Postby ESP_Sprite » Sun Oct 25, 2020 12:38 pm

Hard to say without looking at the API, or without knowing what file the SDK complains about... Not sure if the issue you linked has anything to do with this, by the way, it seems to be for another library on another SDK on another chip (ESP8266).

miacompoot
Posts: 4
Joined: Sun Oct 25, 2020 2:13 am

Re: Mercury API

Postby miacompoot » Sun Oct 25, 2020 7:30 pm

I understand that maybe that is confusing. The error is as follows:

[Executing action: all (aliases: build)
Running ninja in directory c:\users\hassa\desktop\most\mercuryapi-1.35.0.82\c\src\api\build
Executing "ninja all"...
[31/891] cmd.exe /C "cd /D C:\Users\hassa\Desktop\MOST\mer...*********************************************************"
Partition table binary generated. Contents:
*******************************************************************************
# Espressif ESP32 Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
*******************************************************************************
[204/891] Linking C executable test1
FAILED: test1
cmd.exe /C "cd . && C:\Users\hassa\esp\tools\xtensa-esp32-elf\esp-2020r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address -g -Werror -Wall -fPIC CMakeFiles/test1.dir/main.c.obj -o test1 ../lib/LTK/LTKC/Library/libltkc.a ../lib/LTK/LTKC/Library/LLRP.org/libltkctm.a ../libmercuryapi.a && cd ."
c:/users/hassa/esp/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: ../libmercuryapi.a: error adding symbols: file format not recognized
collect2.exe: error: ld returned 1 exit status
[209/891] No download step for 'bootloader'
ninja: build stopped: subcommand failed.
ninja failed with exit code 1]

When I search up the error the github post comes up and concerns me in that the "file format not recognized" is an error that implies the API is not compatible with the microcontroller.

I am wondering if anyone has concrete information on if the Mercury API can for sure or cannot for sure be used with the ESP32 (I am worried I have wasted all this time trying to debug two things that simply are not compatible in architecture) and if they know it can to provide any information on how it can be done.

Thanks again

ESP_Sprite
Posts: 4108
Joined: Thu Nov 26, 2015 4:08 am

Re: Mercury API

Postby ESP_Sprite » Mon Oct 26, 2020 12:45 am

Where does the libmercuryapi.a come from? Is it compiled from sources, or is it a binary library you do not have the sources for?

miacompoot
Posts: 4
Joined: Sun Oct 25, 2020 2:13 am

Re: Mercury API

Postby miacompoot » Mon Oct 26, 2020 8:40 pm

Its a library that comes from creating an archive from the .o files of the api source files. The command run to create it is the one below. We have access to the source files.

"ar -rc libmercuryapi.a serial_transport_posix.o serial_transport_tcp_posix.o tmr_strerror.o tmr_param.o hex_bytes.o tm_reader.o tm_reader_async.o serial_reader.o tmr_loadsave_configuration.o llrp_reader.o llrp_reader_l3.o serial_reader_l3.o tmr_utils.o osdep_posix.o "

ESP_Sprite
Posts: 4108
Joined: Thu Nov 26, 2015 4:08 am

Re: Mercury API

Postby ESP_Sprite » Tue Oct 27, 2020 6:06 am

How do you compile the source files? Would it be an option to create an ESP-IDF component instead, and have ESP-IDF compile the source files itself?

miacompoot
Posts: 4
Joined: Sun Oct 25, 2020 2:13 am

Re: Mercury API

Postby miacompoot » Wed Oct 28, 2020 1:09 am

Could you explain what you mean by an ESP-IDF component.
My understanding is that you think I should have the CMake compile the src files?
If this is correct, do you have any suggestions on how to go about this (any links would be helpful if possible!)

Thanks so much

ESP_Sprite
Posts: 4108
Joined: Thu Nov 26, 2015 4:08 am

Re: Mercury API

Postby ESP_Sprite » Wed Oct 28, 2020 9:01 am

You probably want to start reading here.

Who is online

Users browsing this forum: mamaheshwari and 51 guests