s32k boot problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k boot problem

3,547 Views
guolizhai
Contributor II

HI,

      i use SDK S32K148 ,build a project.when I try modify the link file. the program not work,and the reset is alway low.

      i think the problem is link file.pls look  pictrues. 

       some chips have boot header. has S32K use it like boot header?

0 Kudos
6 Replies

2,593 Views
guolizhai
Contributor II

thanks

   I only use S32DS project from Example.<hello_world_s32K148>,when i put vector table to 0x0000 0000 - 0x0000 0400, the program is OK , when i put vector table to 0x0000 0800 - length = 0x0400.The program is not ok.

and i have a question,what is the different[.section  .vector,"a",%progbits] and [.section .vector ].

thanks a lot.

0 Kudos

2,594 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

attached project is not complete - there is missing debug session, Processor Expert and may be some other stuff. 

Just delete it - and open new one: 

pastedImage_2.png

pastedImage_3.png

As you can see - I moved Interrupt vector table to 0x800 and there is no issue: 

pastedImage_1.png

Jiri 

0 Kudos

2,594 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

got it. Actually part of the .interrupts section is also stack pointer and reset vector handler. So - you need to left this 8 bytes on beginning of Flash. For me is working this setup: 

Linker script: 

MEMORY
{
/* Flash */
m_start (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000008
m_interrupts (RX) : ORIGIN = 0x00000800, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00001410, LENGTH = 0x0007EBF0

/* SRAM_L */
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000

/* SRAM_U */
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00007000
}

/* Define output sections */
SECTIONS
{

.startup :
{
. = ALIGN(4);
KEEP(*(.start_up)) /* Startup code */
} > m_start

Startup code (Startup_S32K148.S):

syntax unified
.arch armv7-m

.section .start_up, "a"
.align 2
.long __StackTop /* Top of Stack */
.long Reset_Handler /* Reset Handler */

.section .isr_vector, "a"
.align 2
.globl __isr_vector
__isr_vector:
.long __StackTop /* Top of Stack */
.long Reset_Handler /* Reset Handler */
.long NMI_Handler /* NMI Handler*/
.long HardFault_Handler /* Hard Fault Handler*/
.long MemManage_Handler /* MPU Fault Handler*/
.long BusFault_Handler /* Bus Fault Handler*/
.long UsageFault_Handler /* Usage Fault Handler*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long 0 /* Reserved*/
.long SVC_Handler /* SVCall Handler*/
.long DebugMon_Handler /* Debug Monitor Handler*/
.long 0 /* Reserved*/
.long PendSV_Handler /* PendSV Handler*/
.long SysTick_Handler /* SysTick Handler*/

/* External Interrupts*/
.long DMA0_IRQHandler /* DMA channel 0 transfer complete*/
.long DMA1_IRQHandler /* DMA channel 1 transfer complete*/
.long DMA2_IRQHandler /* DMA channel 2 transfer complete*/

.

.

.

Hope it helps. 

Jiri 

2,594 Views
guolizhai
Contributor II

hi,

   thanks very much! it is right

0 Kudos

2,594 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

can you please share your project? Moving interrupt vector table to different position should have no effect - the table is  mirrored to beginning of the RAM. 

Jiri

0 Kudos

2,593 Views
guolizhai
Contributor II

thanks

I only use S32DS project from Example.,when i put vector table to 0x0000 0000 - 0x0000 03ff, the program is OK , when i put vector table to 0x0000 0800 - 0x00000bff.The program is not ok. and i have a question,what is the different[.section .vector,"a",%progbits] and [.section .vector ].

thanks a lot.

0 Kudos