This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Build failed for a baremetal

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.

Parents
  • Execution has stopped on HLT #0xF000, which is a "semihosting" call.

    For background information on semihosting, see
    developer.arm.com/.../Using-semihosting-to-access-resources-on-the-host-computer

    When 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 on

    then 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 0
    set semihosting heap-limit 0x80800000
    set semihosting stack-limit 0x80800000
    set semihosting stack-base 0x81000000

    heap-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 0x80400000

    Hope this helps

    Stephen

Reply
  • Execution has stopped on HLT #0xF000, which is a "semihosting" call.

    For background information on semihosting, see
    developer.arm.com/.../Using-semihosting-to-access-resources-on-the-host-computer

    When 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 on

    then 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 0
    set semihosting heap-limit 0x80800000
    set semihosting stack-limit 0x80800000
    set semihosting stack-base 0x81000000

    heap-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 0x80400000

    Hope this helps

    Stephen

Children