Hello,
I am using the CAN-FD kit LPCXpresso54618 and its IDE MCUXpressso IDE v11.1.0. Its the first time that I'm using NXP.
I am trying to include an external library in my project, but it always failed even if I reduce the project to a minimum. I don't know where the error is.
and
"No, it's a compiler incompatibility. MS compilers use '__declspec(dllimport)' to tell the compiler and linker that a function resides in a DLL. I don't know what CW for Win32 uses to do the same thing."
Both from <https://community.nxp.com/thread/21745>
解決済! 解決策の投稿を見る。
Your target is a LPC54618 which is an ARM Cortex-M4 device. This is a 'bare metal' device - it has no software, no operating system - nothing - until you write the code and download it to the device.
The MCUXpresso IDE runs under Windows (or Linux, or Mac) and is known as a a cross-development environment. That is, you use it to compile code to run on the target - in your case the LPC54618. It cannot do anything with host based software, such as libTML, because that is built to run on Windows (or Linux, or Mac...).
In theory, it would be possible to take the source code for libTML and 'port' it to run on the LPC54618 - but, this would be a HUGE effort - libTML relies on a sophisticated operating system to provide all of the services it needs (such a TCP/IP).
DLL (Dynamic Linked Libraries) are specific to Windows (although Linux and Mac have an equivalent, but different mechanism, called dynamic libraries). This is where an operating system dynamically loads the library at run time (normally on-demand) and 'fixes-up' the calls from your application to the correct place in the library. This is done so that many application (potentially running concurrently) can use the exact same code without it needing to be loaded for each application. On Windows, Linux and Mac, this uses Virtual Memory and a demand paged memory management. None of this is available on a LPC54618 - or any other embedded microcontroller (MCU).
MCU's do support statically linked libraries. This is where the library is linked into your application, so it can all be downloaded into your device. This is the type of library supported by MCUXpresso (and IAR, Keil etc).
__declspec is a Windows specific enhancement to C/C++ for the use of DLL's. There is no way to use this for the LPC54618. There is not even an equivalent concept.
You can include external (statically linked) libraries in MCUXpresso, but the libraries have to be specifically written for, or ported to, ARM Cortex-M4 (or M3, or M0 etc) devices.
You need a version of the library that is ported to the ARM Cortex-M4 ( the processor in the LPC54618). From the look of the website, it looks like this library is designed for hosts such as Windows, Linux and Mac and not for embedded.
Many thanks!
I thought ist was possible to include external libraries. Are there any differences in the DLLs or libs? I'm aware that Windows uses DLLs and e.g. Linux uses libs. I thought the implementation in in the IDE on Windows uses the library and then pushes the machine code to the board, so the type of the library is irrelevant.
Is there a tutorial or a simple example somewhere where an external DLL or lib is used? So far I have only found some instructions that describes how to change the properties of the project.
Best regards
Simon
Your target is a LPC54618 which is an ARM Cortex-M4 device. This is a 'bare metal' device - it has no software, no operating system - nothing - until you write the code and download it to the device.
The MCUXpresso IDE runs under Windows (or Linux, or Mac) and is known as a a cross-development environment. That is, you use it to compile code to run on the target - in your case the LPC54618. It cannot do anything with host based software, such as libTML, because that is built to run on Windows (or Linux, or Mac...).
In theory, it would be possible to take the source code for libTML and 'port' it to run on the LPC54618 - but, this would be a HUGE effort - libTML relies on a sophisticated operating system to provide all of the services it needs (such a TCP/IP).
DLL (Dynamic Linked Libraries) are specific to Windows (although Linux and Mac have an equivalent, but different mechanism, called dynamic libraries). This is where an operating system dynamically loads the library at run time (normally on-demand) and 'fixes-up' the calls from your application to the correct place in the library. This is done so that many application (potentially running concurrently) can use the exact same code without it needing to be loaded for each application. On Windows, Linux and Mac, this uses Virtual Memory and a demand paged memory management. None of this is available on a LPC54618 - or any other embedded microcontroller (MCU).
MCU's do support statically linked libraries. This is where the library is linked into your application, so it can all be downloaded into your device. This is the type of library supported by MCUXpresso (and IAR, Keil etc).
__declspec is a Windows specific enhancement to C/C++ for the use of DLL's. There is no way to use this for the LPC54618. There is not even an equivalent concept.
You can include external (statically linked) libraries in MCUXpresso, but the libraries have to be specifically written for, or ported to, ARM Cortex-M4 (or M3, or M0 etc) devices.
Thank you very much. So I have to find another solution. Maybe another protocol than BEEP, which is suitable for my project.
Best Regards
Simon
Perhaps if you explain what you are trying to do, others may be able to suggest possible solutions
My project is a bachelor thesis with the title "Development and implementation of a network interface between a vehicle
and the PC application of a test system with configurable signal evaluation".
I try to create an interface between the vehicle's can-fd from vehicle and ethernet to the measurement laptop of a test system. I was looking for a suitable protocol for ethernet that met the following requirements:
- flexible, high expandability, modular
- protection with checksum
- optional transmission security via ACK
- equipment identifier (e.g. this interface, a display)
- P2P, IPv4
- full duplex
- time stamp or prioritization
I found the BEEP protocol to be the most suitable and found the library libTML (or Vortex) for it.
I don't know if there is anything in FreeRTOS that would help you - there are several network stacks available, that may suit?
FreeRTOS - Real-time operating system for microcontrollers - AWS
Alternatively, there may be something provided in ARM mbed - again, lots of connectivity options.
Thanks for your suggestion. I will work out a solution.