s12zvm bootloader

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

s12zvm bootloader

2,042件の閲覧回数
sohyunjang
Contributor III

I use s12zvm MCU.

And I wnat to make bootloader.

So, I refer to AN4723 and S12ZVM_Bootloader of AN4723SW.

I tested that my code downloading and running is OK.

I fix the code below(my application code),

      //ROM           = READ_ONLY   0xFE0000 TO 0xFFFDFF;
    ->  ROM           = READ_ONLY   0xFE0000 TO 0xFFF000;

But, I wonder how fix the code(my application code),

      OSVECTORS     = READ_ONLY     0xFFFE10 TO   0xFFFFFF;   /* OSEK interrupt vectors (use your vector.o) */

I know that 0xFFFE00 ~ 0xFFFFFF is Interrupt and Startup Vector of bootloader at AN4723 p.9.

Does not matter if I do not fix the code?

ラベル(1)
タグ(2)
0 件の賞賛
返信
6 返答(返信)

1,474件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

This line is commented by default, it is for OSEK interrupt vectors. So you can leave it as it is.

You may refer also to https://community.nxp.com/docs/DOC-335384 

Regards,

Daniel

0 件の賞賛
返信

1,474件の閲覧回数
sohyunjang
Contributor III

Thank you,

But, My application code use      

OSVECTORS     = READ_ONLY     0xFFFE10 TO   0xFFFFFF;   /* OSEK interrupt vectors (use your vector.o) */

It doesn't matter. Right?

Thank you.

0 件の賞賛
返信

1,474件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

I guess you don't use OSEK operation system, right?

So it does not matter, you can comment the line out.

Regards,

Daniel

0 件の賞賛
返信

1,474件の閲覧回数
sohyunjang
Contributor III

Thank you,

Yes, I don't use OSEK operation system.

Actually, I use MC9S12ZVML128_BLDC_Sensorless application.

And, I adjust code in S12zvm.prm

SEGMENTS  /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */

/* Register space  */
/*    IO_SEG        = PAGED         0x000000 TO   0x000FFF; intentionally not defined */

/* RAM */
      RAM           = READ_WRITE  0x001000 TO 0x002FFF;

/* EEPROM */
      EEPROM        = READ_ONLY   0x100000 TO 0x1001FF;

/* non-paged FLASHs */
      //ROM           = READ_ONLY   0xFE0000 TO 0xFFFDFF;
      ROM           = READ_ONLY   0xFE0000 TO 0xFFF000;
 /*   VECTORS       = READ_ONLY     0xFFFE00 TO   0xFFFFFF; intentionally not defined: used for VECTOR commands below */
      OSVECTORS     = READ_ONLY     0xFFFE10 TO   0xFFFFFF;   /* OSEK interrupt vectors (use your vector.o) */
END

I wonder this code

      OSVECTORS     = READ_ONLY     0xFFFE10 TO   0xFFFFFF;   /* OSEK interrupt vectors (use your vector.o) */

thank you.

0 件の賞賛
返信

1,474件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Thanks for the information.

 

Yes, the BLDC app uses OSVECTORS for its vector table (vector.c) for some reason.

But the erase process of the bootloader includes the last sector which holds the memory protection bytes, interrupt vector table and startup vectors. And then it restores both the Flash protection bytes, so the flash is not secured (FSEC == 11 is a secure state), and the start-up vector of the bootloader. The rest of the sector is erased so it allows to program the vector table of the BLDC application.

I would only remove the start-up vector from the BLDC vector.c file,

// ,{ 0x00 ,
// #ifdef IRQ_OFF_1F8_FCN          /*0                    0xFFFE00 + 1F8*/
// IRQ_OFF_1F8_FCN,
// #else
// dummy,
// #endif
// },{ 0x00 ,
// STARTUP_FCN
// }

and modify OSVECTORS:

OSVECTORS = READ_ONLY     0xFFFE10 TO 0xFFFFF7;

Regards,

Daniel

0 件の賞賛
返信

1,474件の閲覧回数
sohyunjang
Contributor III

Thank you for your reply.

And I have additional questions.

I need to add the code of AN4723SW.

and compile Erros is occured.

Out of allocation space in segment ROM at address 0xFFFAD8

The original bootloader code's ROM aera is

      ROM           = READ_ONLY   0xFFF800 TO 0xFFFBFF;   // 1K for the bootloader FLASH-ONLY functions. Each 0x200 is 512
      SHADOW_ROM_S  = READ_ONLY   0xFFFC00 TO 0xFFFDFF;   // 512 for funtions that will be copied to RAM

So, I want to increase the area of ROM.

Can I change the area below?

   ROM           = READ_ONLY   0xFFF100 TO 0xFFFBFF

 

Can I need to modify the downloading PC application?

thank you.

0 件の賞賛
返信