This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Nuttx port question on SVC handler

Hi Nordic,

I'm porting hrs application on nuttx OS. But when I call sd_softdevice_enable function, it goes to "RESET". I read below article which mentions that SVC handler is in soft device, but my coworker said that we have to implement our SVC handler on nuttx OS by ourselves. So I'm very confused. When sd_softdevice_enable gets called, it'll go to SVC assembly code which specify the SVC number. Then what else will the application do? Or will it just pass to SVC handler in Softdevice?

devzone.nordicsemi.com/.../Introduction_to_the_S110_SoftDevice_v1.0.pdf

Thanks, Mich

  • Thanks, now I moved sd_softdevice_enable() to the very beginning of my code. And I got an error msg 0x10(Bad memory access) So I think I do have a SVC call and SVC handler in softdevice responses. I have a different ld file(Nuttx ld file) than the original Nordic gcc ld file. So I'm wondering if it's because of wrong configuration in .ld file. Below is my .ld file. I was doing some try-and-error test, but still didn't work out. Do you have an idea about what might be wrong?

    MEMORY { flash (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000 sram (rwx) : ORIGIN = 0x20002558, LENGTH = 0xdaa8 }

    OUTPUT_ARCH(arm) ENTRY(_stext) SECTIONS { .text : { _stext = ABSOLUTE(.); *(.vectors) (.text .text.) *(.fixup) *(.gnu.warning) (.rodata .rodata.) (.gnu.linkonce.t.) *(.glue_7) *(.glue_7t) *(.got) *(.gcc_except_table) (.gnu.linkonce.r.) _etext = ABSOLUTE(.); } > flash

    .init_section : {
    	_sinit = ABSOLUTE(.);
    	*(.init_array .init_array.*)
    	_einit = ABSOLUTE(.);
    } > flash
    
    .ARM.extab : {
    	*(.ARM.extab*)
    } > flash
    
    __exidx_start = ABSOLUTE(.);
    .ARM.exidx : {
    	*(.ARM.exidx*)
    } > flash
    __exidx_end = ABSOLUTE(.);
    
    _eronly = ABSOLUTE(.);
    
    .data : {
    	 __data_start__ = .;   	
    	_sdata = ABSOLUTE(.);
    	*(.data .data.*)
    	*(.gnu.linkonce.d.*)
    	CONSTRUCTORS
    	_edata = ABSOLUTE(.);
    } > sram AT > flash
    .fs_data :/*MinYang add*/
     {
       PROVIDE(__start_fs_data = .);
       KEEP(*(.fs_data))
       PROVIDE(__stop_fs_data = .);
     } > sram
    .bss : {
    	_sbss = ABSOLUTE(.);
    	*(.bss .bss.*)
    	*(.gnu.linkonce.b.*)
    	*(COMMON)
    	_ebss = ABSOLUTE(.);
    } > sram
    
    /* Stabs debugging sections. */
    .stab 0 : { *(.stab) }
    .stabstr 0 : { *(.stabstr) }
    .stab.excl 0 : { *(.stab.excl) }
    .stab.exclstr 0 : { *(.stab.exclstr) }
    .stab.index 0 : { *(.stab.index) }
    .stab.indexstr 0 : { *(.stab.indexstr) }
    .comment 0 : { *(.comment) }
    .debug_abbrev 0 : { *(.debug_abbrev) }
    .debug_info 0 : { *(.debug_info) }
    .debug_line 0 : { *(.debug_line) }
    .debug_pubnames 0 : { *(.debug_pubnames) }
    .debug_aranges 0 : { *(.debug_aranges) }
    

    }

  • Well it most probably is bad memory ranges in LD file because that's #1 reason of #1 problem asked on this forum. I would suggest to go back to the posts I've linked above and follow suggestions there (also following SDK examples typically leads to success). I'm not able to spend time on recompiling your project and finding out where is exactly the problem, sorry.

  • Hi endnode,

    Thanks for your reply. I figured out the problem and now I can enable my softdevice. Many thanks to you!

Related