Other Parts Discussed in Thread: TM4C123GH6PM
Hi all,
Recently I started to develop a little source for the TivaC Series launchpad (TM4C123GH6PM), but I'm coding in assembly language using Code Composer Studio v6.1.
I want to initializate all the internal registers of the MCU itself, but seems that I can't, because after a certain sets of lines, the compilers fires this strange error:
"[E0200] Offset out of range, must be [-4095,4095]" .
Tried many workaround to fix this error, but it still persist.
Seems that after have coded many lines, my macros stops working, and I don't know why.
Could it be some problem with program counter or similar that after many lines fires up an overflow and the compiler return this error?
Here I link all my code and hope in help, because I don't know what think anymore.
Thanks
ImpostaTiva: .text ;Base Address stba .int 0x0400FE000 ;System Tick Base Address sem .int 0x0400F9000 ;System Exception Module Base Address hibernation .int 0x0400FC000 ;Hibernation Module Base Address fma .int 0x0400FD000 ;Flash Memory Access Base Address eeprom .int 0x0400AF000 ;Eeprom Base Address dma .int 0x0400FF000 ;DMA Base Address gpio_pa .int 0x040058000 ;General Port Input/Output, port A Base Address gpio_pb .int 0x040059000 ;General Port Input/Output, port B Base Address gpio_pc .int 0x04005A000 ;General Port Input/Output, port C Base Address gpio_pd .int 0x04005B000 ;General Port Input/Output, port D Base Address gpio_pe .int 0x04005C000 ;General Port Input/Output, port E Base Address gpio_pf .int 0x04005D000 ;General Port Input/Output, port F Base Address timer0 .int 0x040030000 ;Timer zero Base Address timer1 .int 0x040031000 ;Timer uno Base Address timer2 .int 0x040032000 ;Timer due Base Address timer3 .int 0x040033000 ;Timer tre Base Address timer4 .int 0x040034000 ;Timer quattro Base Address timer5 .int 0x040035000 ;Timer cinque Base Address wideTimer0 .int 0x040036000 ;Wide timer zero Base Address wideTimer1 .int 0x040037000 ;Wide timer uno Base Address wideTimer2 .int 0x04003C000 ;Wide timer due Base Address wideTimer3 .int 0x04003D000 ;Wide timer tre Base Address wideTimer4 .int 0x04003E000 ;Wide timer quattro Base Address wideTimer5 .int 0x04003F000 ;Wide timer cinque Base Address .align 4 ; svc #0x02C ;SuperVisor Call ;Entro in modalità "Privileged" ;per poter imnpostare i registri ;di controllo dell'M4. SetSysTick .macro value,offset ldr r1,value ldr r3,stba ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetSysSem .macro value,offset ldr r1,value ldr r3,sem ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetHib .macro value,offset ldr r1,value ldr r3,hibernation ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetFma .macro value,offset ldr r1,value ldr r3,fma ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetEeprom .macro value,offset ldr r1,value ldr r3,eeprom ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetDma .macro value,offset ldr r1,value ldr r3,dma ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetGpioPA .macro value,offset ldr r1,value ldr r3,gpio_pa ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetGpioPB .macro value,offset mov r1,#value ldr r3,gpio_pb ldr r2,offset add r4,r3,r2 str r1,[r4] .endm ldr r1,gpiopctl_pb_value ldr r3,gpio_pb ldr r2,gpiopctl_pb_offset add r4,r3,r2 str r1,[r4] SetGpioPC .macro value,offset ldr r1,value ; ldr r3,gpio_pc ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetGpioPD .macro value,offset ldr r1,value ; ldr r3,gpio_pd ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetGpioPE .macro value,offset ldr r1,value ; ldr r3,gpio_pe ldr r2,offset add r4,r3,r2 str r1,[r4] .endm SetGpioPF .macro value,offset ldr r1,value ; ldr r3,gpio_pf ldr r2,offset add r4,r3,r2 str r1,[r4] .endm ;indirizzo .field 0x0400AF000 ;offset .field 0x0FFF ;valore .field 0x0FFFFFFFF ; .align 4 ; ldr r3,valore ; ldr r1,eeprom ; ldr r2,offset ; ldr r1,[r1,r2] ; str r3,[r1] pborctl_value .int 0x06 pborctl_offset .int 0x060 SetSysTick pborctl_value,pborctl_offset imc_value .int 0x0 imc_offset .int 0x054 SetSysTick imc_value,imc_offset misc_value .int 0x0DCA misc_offset .int 0x058 SetSysTick misc_value,misc_offset resc_value .int 0x0 resc_offset .int 0x05C SetSysTick resc_value,resc_offset rcc_value .int 0x015E0611 rcc_offset .int 0x060 SetSysTick rcc_value,rcc_offset rcc2_value .int 0x0C1004010 rcc2_offset .int 0x070 SetSysTick rcc2_value,rcc2_offset gpiohbctl_value .int 0x03F gpiohbctl_offset .int 0x06C SetSysTick gpiohbctl_value,gpiohbctl_offset moscctl_value .int 0x06 moscctl_offset .int 0x07C SetSysTick moscctl_value,moscctl_offset dslpclkcfg_value .int 0x010 dslpclkcfg_offset .int 0x0144 SetSysTick dslpclkcfg_value,dslpclkcfg_offset piosccal_value .int 0x0 piosccal_offset .int 0x0150 SetSysTick piosccal_value,piosccal_offset slppwrcfg_value .int 0x0 slppwrcfg_offset .int 0x0188 SetSysTick slppwrcfg_value,slppwrcfg_offset dslppwrcfg_value .int 0x0 dslppwrcfg_offset .int 0x018C SetSysTick dslppwrcfg_value,dslppwrcfg_offset ldospctl_value .int 0x080000018 ldospctl_offset .int 0x01B4 SetSysTick ldospctl_value,ldospctl_offset ldodpctl_value .int 0x080000018 ldodpctl_offset .int 0x01BC SetSysTick ldodpctl_value,ldodpctl_offset srwd_value .int 0x03 srwd_offset .int 0x0500 SetSysTick srwd_value,srwd_offset srtimer_value .int 0x0 srtimer_offset .int 0x0504 SetSysTick srtimer_value,srtimer_offset srgpio_value .int 0x0 srgpio_offset .int 0x0508 SetSysTick srgpio_value,srgpio_offset srdma_value .int 0x0 srdma_offset .int 0x050C SetSysTick srdma_value,srdma_offset srhib_value .int 0x01 srhib_offset .int 0x0514 SetSysTick srhib_value,srhib_offset sruart_value .int 0x0 sruart_offset .int 0x0518 SetSysTick sruart_value,sruart_offset srssi_value .int 0x0 srssi_offset .int 0x051C SetSysTick srssi_value,srssi_offset sri2c_value .int 0x0 sri2c_offset .int 0x0520 SetSysTick sri2c_value,sri2c_offset srusb_value .int 0x0 srusb_offset .int 0x0528 SetSysTick srusb_value,srusb_offset srcan_value .int 0x0 srcan_offset .int 0x0534 SetSysTick srcan_value,srcan_offset sradc_value .int 0x0 sradc_offset .int 0x0538 SetSysTick sradc_value,sradc_offset sracmp_value .int 0x0 sracmp_offset .int 0x053C SetSysTick sracmp_value,sracmp_offset srpwm_value .int 0x0 srpwm_offset .int 0x0540 SetSysTick srpwm_value,srpwm_offset srqei_value .int 0x0 srqei_offset .int 0x0544 SetSysTick srqei_value,srqei_offset sreeprom_value .int 0x0 sreeprom_offset .int 0x0558 SetSysTick sreeprom_value,sreeprom_offset srwtimer_value .int 0x0 srwtimer_offset .int 0x055C SetSysTick srwtimer_value,srwtimer_offset rcgcwd_value .int 0x03 rcgcwd_offset .int 0x0600 SetSysTick rcgcwd_value,rcgcwd_offset rcgctimer_value .int 0x0 rcgctimer_offset .int 0x0604 SetSysTick rcgctimer_value,rcgctimer_offset rcgcgpio_value .int 0x03F rcgcgpio_offset .int 0x0608 SetSysTick rcgcgpio_value,rcgcgpio_offset rcgcdma_value .int 0x01 rcgcdma_offset .int 0x060C SetSysTick rcgcdma_value,rcgcdma_offset rcgchib_value .int 0x0 rcgchib_offset .int 0X0614 SetSysTick rcgchib_value,rcgchib_offset rcgcuart_value .int 0x0FF rcgcuart_offset .int 0x0618 SetSysTick rcgcuart_value,rcgcuart_offset rcgcssi_value .int 0x0F rcgcssi_offset .int 0x061C SetSysTick rcgcssi_value,rcgcssi_offset rcgci2c_value .int 0x0F rcgci2c_offset .int 0x0620 SetSysTick rcgci2c_value,rcgci2c_offset rcgcusb_value .int 0x01 rcgcusb_offset .int 0x0628 SetSysTick rcgcusb_value,rcgcusb_offset rcgccan_value .int 0x03 rcgccan_offset .int 0x0634 SetSysTick rcgccan_value,rcgccan_offset rcgcadc_value .int 0x03 rcgcadc_offset .int 0x0638 SetSysTick rcgcadc_value,rcgcadc_offset rcgcacmp_value .int 0x01 rcgcacmp_offset .int 0x063C SetSysTick rcgcacmp_value,rcgcacmp_offset rcgcpwm_value .int 0x03 rcgcpwm_offset .int 0x0644 SetSysTick rcgcpwm_value,rcgcpwm_offset rcgcqei_value .int 0x03 rcgcqei_offset .int 0x0644 SetSysTick rcgcqei_value,rcgcqei_offset rcgceeprom_value .int 0x01 rcgceeprom_offset .int 0x0658 SetSysTick rcgceeprom_value,rcgceeprom_offset rcgcwtimer_value .int 0x03F rcgcwtimer_offset .int 0x065C SetSysTick rcgcwtimer_value,rcgcwtimer_offset scgcwd_value .int 0x03 scgcwd_offset .int 0x0700 SetSysTick scgcwd_value,scgcwd_offset scgctimer_value .int 0x03F scgctimer_offset .int 0x0704 SetSysTick scgctimer_value,scgctimer_offset scgcgpio_value .int 0x03F scgcgpio_offset .int 0x0708 SetSysTick scgcgpio_value,scgcgpio_offset scgcdma_value .int 0x01 scgcdma_offset .int 0x070C SetSysTick scgcdma_value,scgcdma_offset scgchib_value .int 0x0 scgchib_offset .int 0x0714 SetSysTick scgchib_value,scgchib_offset scgcuart_value .int 0x0FF scgcuart_offset .int 0x0718 SetSysTick scgcuart_value,scgcuart_offset scgcssi_value .int 0x0F scgcssi_offset .int 0x071C SetSysTick scgcssi_value,scgcssi_offset scgci2c_value .int 0x0F scgci2c_offset .int 0x0720 SetSysTick scgci2c_value,scgci2c_offset scgcusb_value .int 0x01 scgcusb_offset .int 0x0728 SetSysTick scgcusb_value,scgcusb_offset scgccan_value .int 0x03 scgccan_offset .int 0x0734 SetSysTick scgccan_value,scgccan_offset scgcadc_value .int 0x03 scgcadc_offset .int 0x0738 SetSysTick scgcadc_value,scgcadc_offset scgcacmp_value .int 0x01 scgcacmp_offset .int 0x073C SetSysTick scgcacmp_value,scgcacmp_offset scgcpwm_value .int 0x03 scgcpwm_offset .int 0x0740 SetSysTick scgcpwm_value,scgcpwm_offset scgcqei_value .int 0x03 scgcqei_offset .int 0x0744 SetSysTick scgcqei_value,scgcqei_offset scgceeprom_value .int 0x01 scgceeprom_offset .int 0x0758 SetSysTick scgceeprom_value,scgceeprom_offset scgcwtimer_value .int 0x03F scgcwtimer_offset .int 0x075C SetSysTick scgcwtimer_value,scgcwtimer_offset dcgcwd_value .int 0x03 dcgcwd_offset .int 0x0800 SetSysTick dcgcwd_value,dcgcwd_offset dcgctimer_value .int 0x03F dcgctimer_offset .int 0x0804 SetSysTick dcgctimer_value,dcgctimer_offset dcgcgpio_value .int 0x03F dcgcgpio_offset .int 0x0808 SetSysTick dcgcgpio_value,dcgcgpio_offset dcgcdma_value .int 0x01 dcgcdma_offset .int 0x080C SetSysTick dcgcdma_value,dcgcdma_offset dcgchib_value .int 0x0 dcgchib_offset .int 0x0814 SetSysTick dcgchib_value,dcgchib_offset dcgcusart_value .int 0x0FF dcgcusart_offset .int 0x0818 SetSysTick dcgcusart_value,dcgcusart_offset dcgcssi_value .int 0x0F dcgcssi_offset .int 0x081C SetSysTick dcgcssi_value,dcgcssi_offset dcgci2c_value .int 0x0F dcgci2c_offset .int 0x0820 SetSysTick dcgci2c_value,dcgci2c_offset dcgcusb_value .int 0x01 dcgcusb_offset .int 0x0828 SetSysTick dcgcusb_value,dcgcusb_offset dcgccan_value .int 0x03 dcgccan_offset .int 0x0834 SetSysTick dcgccan_value,dcgccan_offset dcgcadc_value .int 0x03 dcgcadc_offset .int 0x0838 SetSysTick dcgcadc_value,dcgcadc_offset dcgcacmp_value .int 0x01 dcgcacmp_offset .int 0x083C SetSysTick dcgcacmp_value,dcgcacmp_offset dcgcpwm_value .int 0x03 dcgcpwm_offset .int 0x0840 SetSysTick dcgcpwm_value,dcgcpwm_offset dcgcqei_value .int 0x03 dcgcqei_offset .int 0x0844 SetSysTick dcgcqei_value,dcgcqei_offset dcgceeprom_value .int 0x01 dcgceeprom_offset .int 0x0858 SetSysTick dcgceeprom_value,dcgceeprom_offset dcgcwtimer_value .int 0x03F dcgcwtimer_offset .int 0x085C SetSysTick dcgcwtimer_value,dcgcwtimer_offset rmctl_value .int 0x01 rmctl_offset .int 0x0F0 SetSysTick rmctl_value,rmctl_offset sysexcim_value .int 0x0 sysexcim_offset .int 0x04 SetSysSem sysexcim_value,sysexcim_offset sysexcic_value .int 0x03C sysexcic_offset .int 0x0C SetSysSem sysexcic_value,sysexcic_offset hibrtcc_value .int 0x0 hibrtcc_offset .int 0x0 SetHib hibrtcc_value,hibrtcc_offset hibrtcm0_value .int 0x0FFFFFFFF hibrtcm0_offset .int 0x04 SetHib hibrtcm0_value,hibrtcm0_offset hibrtcld_value .int 0x0 hibrtcld_offset .int 0x0C SetHib hibrtcld_value,hibrtcld_offset hibctl_value .int 0x0161D8 hibctl_offset .int 0x010 SetHib hibctl_value,hibctl_offset hibim_value .int 0x0 hibim_offset .int 0x014 SetHib hibim_value,hibim_offset hibic_value .int 0x0001D hibic_offset .int 0x020 SetHib hibic_value,hibic_offset hibrtct_value .int 0x07FFF hibrtct_offset .int 0x024 SetHib hibrtct_value,hibrtct_offset hibrtcss_value .int 0x0 hibrtcss_offset .int 0x028 SetHib hibrtcss_value,hibrtcss_offset fma_value .int 0x0 fma_offset .int 0x0 SetFma fma_value,fma_offset fmd_value .int 0x0 fmd_offset .int 0x04 SetFma fmd_value,fmd_offset fmc_value .int 0x071D50000 fmc_offset .int 0x08 SetFma fmc_value,fmc_offset fcim_value .int 0x0 fcim_offset .int 0x010 SetFma fcim_value,fcim_offset fcmisc_value .int 0x02E07 fcmisc_offset .int 0x014 SetFma fcmisc_value,fcmisc_offset fmc2_value .int 0x071D50000 fmc2_offset .int 0x020 SetFma fmc2_value,fmc2_offset fwbval_value .int 0x0 fwbval_offset .int 0x030 SetFma fwbval_value,fwbval_offset eesize_value .int 0x0 eesize_offset .int 0x0 SetEeprom eesize_value,eesize_offset eeblock_value .int 0x0 eeblock_offset .int 0x04 SetEeprom eeblock_value,eeblock_offset eeoffset_value .int 0x0 eeoffset_offset .int 0x08 SetEeprom eeoffset_value,eeoffset_offset eerdwr_value .int 0x0FFFFFFFF eerdwr_offset .int 0x010 SetEeprom eerdwr_value,eerdwr_offset eerdwrinc_value .int 0x0FFFFFFFF eerdwrinc_offset .int 0x014 SetEeprom eerdwrinc_value,eerdwrinc_offset eesup_value .int 0x0 eesup_offset .int 0x01C SetEeprom eesup_value,eesup_offset eeunlock_value .int 0x020 eeunlock_offset .int 0x020 SetEeprom eeunlock_value,eeunlock_offset eeprot_value .int 0x0 eeprot_offset .int 0x030 SetEeprom eeprot_value,eeprot_offset eeint_value .int 0x0 eeint_offset .int 0x040 SetEeprom eeint_value,eeint_offset eehide_value .int 0x0 eehide_offset .int 0x050 SetEeprom eehide_value,eehide_offset eedbgme_value .int 0x0E37B0001 eedbgme_offset .int 0x080 SetEeprom eedbgme_value,eedbgme_offset dmacfg_value .int 0x01 dmacfg_offset .int 0x04 SetDma dmacfg_value,dmacfg_offset dmaburstset_value .int 0x0FFFFFFFF dmaburstset_offset .int 0x018 SetDma dmaburstset_value,dmaburstset_offset dmaburstclr_value .int 0x0 dmaburstclr_offset .int 0x01C SetDma dmaburstclr_value,dmaburstclr_offset dmareqmskset_value .int 0x0 dmareqmskset_offset .int 0x020 SetDma dmareqmskset_value,dmareqmskset_offset dmareqmskclr_value .int 0x0FFFFFFFF dmareqmskclr_offset .int 0x024 SetDma dmareqmskclr_value,dmareqmskclr_offset dmaenaset_value .int 0x0FFFFFFFF dmaenaset_offset .int 0x028 SetDma dmaenaset_value,dmaenaset_offset dmaenaclr_value .int 0x0 dmaenaclr_offset .int 0x02C SetDma dmaenaclr_value,dmaenaclr_offset dmaaltset_value .int 0x0 dmaaltset_offset .int 0x030 SetDma dmaaltset_value,dmaaltset_offset dmaaltclr_value .int 0x0FFFFFFFF dmaaltclr_offset .int 0x034 SetDma dmaaltclr_value,dmaaltclr_offset dmaprioset_value .int 0x0 dmaprioset_offset .int 0x038 SetDma dmaprioset_value,dmaprioset_offset dmaprioclr_value .int 0x0FFFFFFFF dmaprioclr_offset .int 0x03C SetDma dmaprioclr_value,dmaprioclr_offset dmaerrclr_value .int 0x0 dmaerrclr_offset .int 0x04C SetDma dmaerrclr_value,dmaerrclr_offset dmachis_value .int 0x0FFFFFFFF dmachis_offset .int 0x0504 SetDma dmachis_value,dmachis_offset dmachmap0_value .int 0x0 dmachmap0_offset .int 0x0510 SetDma dmachmap0_value,dmachmap0_offset dmachmap1_value .int 0x0 dmachmap1_offset .int 0x0514 SetDma dmachmap1_value,dmachmap1_offset dmachmap2_value .int 0x0 dmachmap2_offset .int 0x0518 SetDma dmachmap2_value,dmachmap2_offset dmachmap3_value .int 0x0 dmachmap3_offset .int 0x051C SetDma dmachmap3_value,dmachmap3_offset gpiolock_pa_value .int 0x04C4F434B gpiolock_pa_offset .int 0x0520 SetSysTick gpiolock_pa_value,gpiolock_pa_offset gpiolock_pb_value .int 0x04C4F434B gpiolock_pb_offset .int 0x0520 SetSysTick gpiolock_pb_value,gpiolock_pb_offset gpiolock_pc_value .int 0x04C4F434B gpiolock_pc_offset .int 0x0520 SetSysTick gpiolock_pc_value,gpiolock_pc_offset gpiolock_pd_value .int 0x04C4F434B gpiolock_pd_offset .int 0x0520 SetSysTick gpiolock_pd_value,gpiolock_pd_offset gpiolock_pe_value .int 0x04C4F434B gpiolock_pe_offset .int 0x0520 SetSysTick gpiolock_pe_value,gpiolock_pe_offset gpiolock_pf_value .int 0x04C4F434B gpiolock_pf_offset .int 0x0520 SetSysTick gpiolock_pf_value,gpiolock_pf_offset gpiocr_pa_value .int 0x0FF gpiocr_pa_offset .int 0x0524 SetSysTick gpiocr_pa_value,gpiocr_pa_offset gpiocr_pb_value .int 0x0FF gpiocr_pb_offset .int 0x0524 SetSysTick gpiocr_pb_value,gpiocr_pb_offset gpiocr_pc_value .int 0x0FF gpiocr_pc_offset .int 0x0524 SetSysTick gpiocr_pc_value,gpiocr_pc_offset gpiocr_pd_value .int 0x0FF gpiocr_pd_offset .int 0x0524 SetSysTick gpiocr_pd_value,gpiocr_pd_offset gpiocr_pe_value .int 0x0FF gpiocr_pe_offset .int 0x0524 SetSysTick gpiocr_pe_value,gpiocr_pe_offset gpiocr_pf_value .int 0x0FF gpiocr_pf_offset .int 0x0524 SetSysTick gpiocr_pf_value,gpiocr_pf_offset gpioafsel_pa_value .int 0x0C3 gpioafsel_pa_offset .int 0x0420 SetSysTick gpioafsel_pa_value,gpioafsel_pa_offset gpioafsel_pb_value .int 0x0 gpioafsel_pb_offset .int 0x0420 SetSysTick gpioafsel_pb_value,gpioafsel_pb_offset gpioafsel_pc_value .int 0x0F gpioafsel_pc_offset .int 0x0420 SetSysTick gpioafsel_pc_value,gpioafsel_pc_offset gpioafsel_pd_value .int 0x030 gpioafsel_pd_offset .int 0x0420 SetSysTick gpioafsel_pd_value,gpioafsel_pd_offset gpioafsel_pe_value .int 0x0 gpioafsel_pe_offset .int 0x0420 SetSysTick gpioafsel_pe_value,gpioafsel_pe_offset gpioafsel_pf_value .int 0x01F gpioafsel_pf_offset .int 0x0420 SetSysTick gpioafsel_pf_value,gpioafsel_pf_offset gpiopctl_pa_value .int 0x0 gpiopctl_pa_offset .int 0x052C SetGpioPA gpiopctl_pa_value,gpiopctl_pa_offset gpiopctl_pb_value .int 0x0 gpiopctl_pb_offset .int 0x052C ; SetGpioPB gpiopctl_pb_value,gpiopctl_pb_offset ldr r1,gpio_pb ldr r3,[r1] ldr r2,gpiopctl_pb_offset add r4,r3,r2 str r1,[r4] gpiopctl_pc_value .int 0x01111 gpiopctl_pc_offset .int 0x052C SetGpioPC gpiopctl_pc_value,gpiopctl_pc_offset gpiopctl_pd_value .int 0x0 gpiopctl_pd_offset .int 0x052C SetGpioPD gpiopctl_pd_value,gpiopctl_pd_offset gpiopctl_pe_value .int 0x0 gpiopctl_pe_offset .int 0x052C SetGpioPE gpiopctl_pe_value,gpiopctl_pe_offset gpiopctl_pf_value .int 0x0 gpiopctl_pf_offset .int 0x052C SetGpioPF gpiopctl_pf_value,gpiopctl_pf_offset ; bx lr ;Esco dalla modalità "Privileged" ;torno alla mdalità normale: ;"Threaded" e restituisco il ;controllo.

