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

Parents
  • Thanks for your answer. How do I know that the SVCcall in the application actually call SVC handler in softdevice handler?
    I have SVC handler at my application and I do see it goes to SVC handler at my application. I'm not sure if it goes to SVC handler in softdevice first or directly go to SVC handler at my application. BTW, I get a an error code 0x200055C0 when calling sd_softdevice_enable(). It looks like an address... Please help!

    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) }
    

    }

Reply
  • 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) }
    

    }

Children
No Data
Related