I’m trying to port the demo application to an actual hardware instance of the Xtensa LX-6 processor, with the hifi3 coprocessor. I’m using the “ThirdParty/XCC/Xtensa” port. I have also checked the kernel out from the foss-xtensa site, and I see that they are identical.
First issue, my build configuration sets XCHAL_CP_NUM to 1, which will bring in the MPU support. When I try to build port.c, I get an error with a mismatched prototype:
/*
Is there some configuration to set? I think having a coprocessor will cause the MPU subsystem to be included (and this may not be the case in the sim). Further, I’m using the RI-2022.10 toolset, which ONLY supports the clang compiler (XCC has been deprecated). I’m looking for any suggestions here.
Hi Gaurav,
Thanks for the response. I did try building with the above repository, and I get the following errors:
Cannot find asm-offsets.h, I cannot find this in any of my XtDevTools directories or in the build directories for any configuration. It is not in the repository.
Having problem with MPU, getting the error “requested alignment is not a power of 2” in mpu_basic.c
Processor configuration for MPU
$ grep -r XCHAL_MPU_ALIGN *
src/config/core.h:#define XCHAL_MPU_ALIGN_REQ 1 /* MPU requires alignment of entries to background map /
src/config/core.h:#define XCHAL_MPU_ALIGN_BITS 0
src/config/core.h:#define XCHAL_MPU_ALIGN 0
src/cstub/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN_REQ 1 / MPU requires alignment of entries to background map /
src/cstub/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN_BITS 0
src/cstub/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN 0
src/cstub64/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN_REQ 1 / MPU requires alignment of entries to background map /
src/cstub64/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN_BITS 0
src/cstub64/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN 0
xtensa-elf/arch/include/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN_REQ 1 / MPU requires alignment of entries to background map /
xtensa-elf/arch/include/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN_BITS 0
xtensa-elf/arch/include/xtensa/config/core-isa.h:#define XCHAL_MPU_ALIGN 0xtensa-elf/src/linux/misc/core.h:#define XCHAL_MPU_ALIGN_REQ 1 / MPU requires alignment of entries to background map */
xtensa-elf/src/linux/misc/core.h:#define XCHAL_MPU_ALIGN_BITS 0
xtensa-elf/src/linux/misc/core.h:#define XCHAL_MPU_ALIGN 0
This seems closer, but still it seems that having the MPU turned on is problematic.
Also - I did take a look at the code base that Guarav pointed you to. For…
Cannot find asm-offsets.h, I cannot find this in any of my XtDevTools directories or in the build directories for any configuration. It is not in the repository.
It looks like it’s being generated by the Xtensa Makefile. This should generate the asm-offsets.h file in the build directory. Can you try building and seeing if this file appears?