hello,
While I am trying to execute a simple bubble sort program in c as provided as an example in the arm development studio IDE, I am facing 3 errors like as shown below: (Target and source must be capability)
/bubblesort.c:45:37: error: invalid target type 'uint32_t *' (aka 'unsigned int *') for __cheri_tocap: target must be a capability seq_t sequence = (__cheri_tocap seq_t)malloc(sizeof(uint32_t) * SEQ_LEN);
../bubblesort.c:57:33: error: invalid source type 'uint32_t *' (aka 'unsigned int *') for __cheri_fromcap: source must be a capability free((__cheri_fromcap void*)sequence);
/bubblesort.c:70:6: error: conflicting types for 'print'void print (seq_t __cheri_input sequence, int size) {
N.B: I am using LLVM 13.0.0 with Morello support.
Many thanks for your reply. I'll try and update you. Can you please suggest from the list of 2 toolchains which one to use for building the project
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain
I am assuming maybe I am not using the correct compiler version.
Neither points to a Morello toolchain. There is nothing wrong with using Morello LLVM, as you currently are as I understand, otherwise there is also the Morello GNU toolchain:
developer.arm.com/.../arm-gnu-toolchain-for-morello-downloads
Many thanks Kevin. I like to point out one step where I am getting stuck is that while I am trying to download it and run on the morello board the existing elf of the bubblesort program already provided as an example, it program execution is getting stuck at the halt instruction and not proceeding further and as a result the output is not displaying.I am showing a screenshot for the same.
and under the error log these 2 messages:
Execution has stopped on HLT #0xF000, which is a "semihosting" call.For background information on semihosting, seedeveloper.arm.com/.../Using-semihosting-to-access-resources-on-the-host-computerWhen connected to a model, semihosting is automatically handled by the model.When connected to real hardware, semihosting is disabled by default in the debugger. Semihosting will be enabled in the debugger when an image is loaded that contains the special symbols __auto_semihosting or __semihosting_library_function, or if you explicitly enable semihosting using the command "set semihosting enabled on".To enable semihosting when connected to real hardware, first create a "target initialization" .ds script containing this command:set semihosting enabled onthen open the debug configuration .launch file for your board, select the Debugger tab, and add the script in the "Run target initialization debugger script" field.If required, you can also add other commands into the script to setup the stack & heap, e.g.:set semihosting heap-base 0set semihosting heap-limit 0x80800000set semihosting stack-limit 0x80800000set semihosting stack-base 0x81000000heap-base 0 means "put the heap immediately above ZI (aka .bss) data. If that doesn't work, specify an absolute address with e.g.set semihosting heap-base 0x80400000Hope this helpsStephen
yes I have added that in the initialisation.ds file with the content
set semihosting enabled onset semihosting heap-base 0x80400000set semihosting heap-limit 0x80800000set semihosting stack-limit 0x80800000set semihosting stack-base 0x81000000
but pointed it to the Run target initialization debugger script. But the issue remains. As I step through it moves into an address as shown in the disassembly. The program is running as it shows but I couldn't see the output on the console
I made a fresh post describing the problem in this link
community.arm.com/.../baremetal-program-execution-on-arm-morello-board