Hi to All
I'm just begining to use this uC working with STVD and Raisonance toolchain (compiler version is: RCSTM8 COMPILER V2.17.09.139 Lite (16 Kb code limited), linker version is: RLST7 LINKER/LOCATOR V2.17.09.139).
I have some doubts on the map file, from manual of ST it says that memory regions from 0x00 806C to 0x00 807C are reserved, but in the map file says another thing (see below partial map file)
My INTSECTION0 starts right on 0x00 8060, is this correct or not?
It seems strange for me.
Thank's to All.
TYPE BASE LENGTH RELOCATION SEGMENT NAME
---- ---- ------ ---------- ------------
* * * * * * * * D A T A M E M O R Y * * * * * * * *
DATA 000000H 000001H PAGE0 ?ED0?MAIN
DATA 000001H 000004H PAGE0 ?ED0?SYS_UART
DATA 000005H 00000CH PAGE0 ?D0?STM8S_CLK
DATA 000011H 000004H PAGE0 SEG_REGISTERS
000015H 0001EBH *** GAP ***
DATA 000200H 000200H UNIT ?C_STACK?SEG
* * * * * * * * C O D E M E M O R Y * * * * * * * *
CODE 008000H 000004H AT ?CO?STARTUP_V00
CODE 008004H 000004H AT ?IT?VECTOR#256
CODE 008008H 000004H AT ?IT?VECTOR#0
CODE 00800CH 000004H AT ?IT?VECTOR#1
CODE 008010H 000004H AT ?IT?VECTOR#2
CODE 008014H 000004H AT ?IT?VECTOR#3
CODE 008018H 000004H AT ?IT?VECTOR#4
CODE 00801CH 000004H AT ?IT?VECTOR#5
CODE 008020H 000004H AT ?IT?VECTOR#6
CODE 008024H 000004H AT ?IT?VECTOR#7
CODE 008028H 000004H AT ?IT?VECTOR#8
CODE 00802CH 000004H AT ?IT?VECTOR#9
CODE 008030H 000004H AT ?IT?VECTOR#10
CODE 008034H 000004H AT ?IT?VECTOR#11
CODE 008038H 000004H AT ?IT?VECTOR#12
CODE 00803CH 000004H AT ?IT?VECTOR#13
CODE 008040H 000004H AT ?IT?VECTOR#14
CODE 008044H 000004H AT ?IT?VECTOR#15
CODE 008048H 000004H AT ?IT?VECTOR#16
CODE 00804CH 000004H AT ?IT?VECTOR#17
CODE 008050H 000004H AT ?IT?VECTOR#18
CODE 008054H 000004H AT ?IT?VECTOR#19
CODE 008058H 000004H AT ?IT?VECTOR#20
CODE 00805CH 000004H AT ?IT?VECTOR#21
CODE 008060H 000004H AT ?IT?VECTOR#22
CODE 008064H 000004H AT ?IT?VECTOR#23
CODE 008068H 000004H AT ?IT?VECTOR#24
CODE 00806CH 000001H INSECTION0 ?PR??SW_IRQHANDLER?STM8S_ITC
CODE 00806DH 000001H INSECTION0 ?PR??TLI_IRQHANDLER?STM8S_ITC
CODE 00806EH 000001H INSECTION0 ?PR??AWU_IRQHANDLER?STM8S_ITC
CODE 00806FH 000001H INSECTION0 ?PR??CLK_IRQHANDLER?STM8S_ITC
CODE 008070H 000001H INSECTION0 ?PR??EXTI_PORTA_IRQHANDLER?STM8S_ITC
CODE 008071H 000001H INSECTION0 ?PR??EXTI_PORTB_IRQHANDLER?STM8S_ITC
CODE 008072H 000001H INSECTION0 ?PR??EXTI_PORTC_IRQHANDLER?STM8S_ITC
CODE 008073H 000001H INSECTION0 ?PR??EXTI_PORTD_IRQHANDLER?STM8S_ITC
CODE 008074H 000001H INSECTION0 ?PR??EXTI_PORTE_IRQHANDLER?STM8S_ITC
CODE 008075H 000001H INSECTION0 ?PR??CAN_RX_IRQHANDLER?STM8S_ITC
CODE 008076H 000001H INSECTION0 ?PR??CAN_TX_IRQHANDLER?STM8S_ITC
CODE 008077H 000001H INSECTION0 ?PR??SPI_IRQHANDLER?STM8S_ITC
CODE 008078H 000001H INSECTION0 ?PR??TIM1_UPD_OVF_TRG_BRK_IRQHANDLER?STM8S_ITC
CODE 008079H 000001H INSECTION0 ?PR??TIM1_CAP_COM_IRQHANDLER?STM8S_ITC
CODE 00807AH 000001H INSECTION0 ?PR??TIM2_UPD_OVF_BRK_IRQHANDLER?STM8S_ITC
CODE 00807BH 000001H INSECTION0 ?PR??TIM2_CAP_COM_IRQHANDLER?STM8S_ITC
CODE 00807CH 000001H INSECTION0 ?PR??TIM3_UPD_OVF_BRK_IRQHANDLER?STM8S_ITC
CODE 00807DH 000001H INSECTION0 ?PR??TIM3_CAP_COM_IRQHANDLER?STM8S_ITC
CODE 00807EH 000020H INSECTION0 ?PR??UART1_TX_IRQHANDLER?STM8S_ITC
CODE 00809EH 000020H INSECTION0 ?PR??UART1_RX_IRQHANDLER?STM8S_ITC
CODE 0080BEH 000001H INSECTION0 ?PR??I2C_IRQHANDLER?STM8S_ITC
CODE 0080BFH 000001H INSECTION0 ?PR??UART2_TX_IRQHANDLER?STM8S_ITC
CODE 0080C0H 000001H INSECTION0 ?PR??UART2_RX_IRQHANDLER?STM8S_ITC
CODE 0080C1H 000001H INSECTION0 ?PR??ADC1_IRQHANDLER?STM8S_ITC
CODE 0080C2H 000001H INSECTION0 ?PR??TIM4_UPD_OVF_IRQHANDLER?STM8S_ITC
CODE 0080C3H 000001H INSECTION0 ?PR??EEPROM_EEC_IRQHANDLER?STM8S_ITC
CODE 0080C4H 000178H INSECTION0 CSTDLIB
CODE 00823CH 00001BH INSECTION ?PR?MAIN?MAIN
CODE 008257H 000088H INSECTION ?PR??SYS_CONFIGCLOCK?SYS_CLOCK
CODE 0082DFH 00003DH INSECTION ?PR??CLK_DEINIT?STM8S_CLK
CODE 00831CH 000125H INSECTION ?PR??CLK_CLOCKSWITCHCONFIG?STM8S_CLK
CODE 008441H 000065H INSECTION ?PR??CLK_SYSCLKCONFIG?STM8S_CLK
CODE 0084A6H 000019H INSECTION ?PR??FLASH_UNLOCK?STM8S_FLASH
CODE 0084BFH 000053H INSECTION ?PR??FLASH_PROGRAMOPTIONBYTE?STM8S_FLASH
CODE 008512H 00005BH INSECTION ?PR??FLASH_READOPTIONBYTE?STM8S_FLASH
CODE 00856DH 00001BH INSECTION ?PR??FLASH_SETPROGRAMMINGTIME?STM8S_FLASH
CODE 008588H 000056H INSECTION ?PR??FLASH_WAITFORLASTOPERATION?STM8S_FLASH
CODE 0085DEH 000018H INSECTION0 CSTDLIB_IX
CODE 0085F6H 000029H INSECTION0 CSTART
CODE 00861FH 000012H UNIT ?PR?STATINIT
|
Hi Ipur,
Your map file looks ok. On STM8S103 addresses 0x8000-0x807F are reserved for 32 interrupt vectors. If they are not used their ROM space can be used as standard flash (although it does not look as a good idea, as there is plenty of ROM anyway).
Do you have a specific issue with the linker?
Regards,
Bruno
Hi Bruno
Thank's a lot for the replay. For your question I have no issue with the linker and everything seems working fine!
Anoter question if I canin this post is: For an ISR function for Reset is the only way to implement it on the start-up file only or may I make it in a C file?
Thank's for the bet support!
Ciao
Franco
Hi Franco,
The reset handler can only be handled through the startup file. The sources are provided along with RKit-STM8, so it should not be too difficult to modify.
However:
If you do not initialize glogal variables (NOINITSTATICVAR active for the compiler and no initialized globals), then the linker will detect it and will automatically configure your output project with NO STARTUP.
This means that main() is the actual reset handler in such a case. You can then manually initialize your globals within main.
Here is an example:
I hope this helps,
Bruno
Thank's a lot Bruno!
Ciao
Ipur Ocnarf