ARM-software / CSAL

Coresight Access Library
Other
107 stars 42 forks source link

Building the library for Cortex-M #17

Closed HokageM closed 3 months ago

HokageM commented 3 months ago

I tried to build the library for a Cortex-M board with a ARMv7e-M architecture.

I set ARCH=arm and CROSS_COMPILE=Path/to/arm-none-eabi- (gcc).

The build failed with:

In file included from ../source/cs_init_manage.c:25:
../source/cs_access_cmnfns.h:42:10: fatal error: sys/mman.h: No such file or directory
   42 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.
algrant-arm commented 3 months ago

Thanks for the report, we'll investigate but did you set BAREMETAL=1? One of BAREMETAL, UNIX_USERSPACE and UNIX_KERNEL needs to be set, the default is UNIX_USERSPACE - I don't believe it's clever enough to detect that it's cross-compiling for M-profile.

algr commented 3 months ago

Testing with "make BAREMETAL=1 CROSS_COMPILE=arm-none-eabi- ARCH=arm" hit a few compiler warnings (mostly around uint32_t), these should now be fixed. I'll leave this open in case anything else shows up.

HokageM commented 3 months ago

Thank you for your fast answer! This solves the Problem.