This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Strange "[E0200] Offset out of range, must be [-4095,4095]" error, how fix it?

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.

 

  • Leonardo Chiodi said:
    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]" .

    The ARM documentation for the LDR, PC-relative instruction confirms that the instruction encoding allows for a maximum offset of +/- 4095 between the current PC and the address of the label.

    I haven't calculated the size of your assembler code, but believe the assembler error occurs because the absolute address offset between the ldr r1, gpio_pb instruction and the gpio_pb label exeeds 4095. To remove the error, believe you need to rearrange the layout of the assembly source code so that the labels are with +/-4095 of the instructions which reference the labels.

  • Hi,

    A lot of work - you must know CCS support #include my_file.h, so you can save your work using any *.h files from driverlib (download it and use it if not yet...). Also, for "ldr" instruction, CCS need some special treatment/syntax in .asm, as described in this link. 

    But best is to use the templates/examples from driverlib, written in C. Note Cortex-Mx micros were developed with goal(s) to write all programs (or most part of them) directly in C. No need to .asm; at least only critical routines/functions may be written in .asm.

  • Hello Lenoardo,

    Please post your ASM code and mark the line which causes the issue.

    Regards
    Amit
  • Good new year to you, Amit,

    As friend/poster Petrei has advised (and others have (mistakenly) avoided) should not such posters be "steered" to "C" and your intensive API?

    Poster presents his issue as "strange" - yet far stranger is the rejection of the "tried, true, tested" eased & extensive API.  (when one wanders - by choice - far from the well-marked path - must I "PAY" for his rescue?)  If we don't properly condemn - have we not encouraged?  Can that be good?

    Really - new year dawns - are we to tear out our: rear view cameras, side/front/rear radar, and lane-deviation alerts - to "welcome" a (far) less efficient/productive past?   Few think so - posters SHOULD be advised (discard their horse/buggy) ...  ... (or suffer their self-caused pain silently - and alone...)

  • Happy new year to Amit and all,

     I think this might be down to either a non-existant Literal pool, or one that is out of the 4K range. Chester mentions moving the code about, which would do it, when you discover the right combination. But if you add to the code the problem may re-appear. There's an easier way to do it with the code as-is, by forcing the generation of Literal pools when you need them. This is done with LTORG directive.

    If it is a literal pool problem then, as Chester mentions, the 4K addressing limit of some instructions is being exceeded, and like the OP says, you keep coding and after a while you overrun the 4K limit and things don't work anymore. Forcing the pool/s generation in the middle of the code cures this. 

    What I can't tell you Leonardo is exactly how to experiment in CCS as I don't use it. It doesn't support all of the pseudo assembler mnemonics like MOV32 which are very handy and make for more readable code. If you're coding in C I'm surprised the IDE doesn't do this for you, maybe it's thrown by the extensive use of the macros?

    In IAR to overcome this, and there maybe a better way of doing it, at the end of each subroutine I put:

    LTORG

    as the bottom line and the assembler can use it if it wants to. This creates a pool for use at that position.

    Also, if you write your assembler with labels that are identical to the datasheet, then the assembler becomes much easier to read. The assembler also becomes portable, so for where you have multiple modules a routine is very easily used and converted. The entire device is constructed, and the datasheet is written, in terms of offsets, ARM assembler handles offsets beautifully, so for ease of coding look at using them. So, for instance:

    /* enable DMA controller */
        LDR R0, =UDMA_BASE+DMACFG
        LDR R1, [R0]
        ORR R1, R1, #DMACFG_MASTEN
        STR R1, [R0]

    If you've read and understood the datasheet, you know exactly what that piece of code does, well, when you appreciate that '=' is load effective address as a pointer, and that '[R0]' is 'at the address pointed to by'. In this way you don't needlessly duplicate information. 

    Going round and initialising all the MCU inards before you use it should be standard practice.

    Reference if you need it: www.keil.com/.../armasm_dom1359731147760.htm

  • "Good new year to you, Amit,"

    And a Happy New year to you aswell cb.

    "As friend/poster Petrei has advised (and others have (mistakenly) avoided) should not such posters be "steered" to "C" and your intensive API?
    Poster presents his issue as "strange" - yet far stranger is the rejection of the "tried, true, tested" eased & extensive API. (when one wanders - by choice - far from the well-marked path -"

    It might be well-marked to you, but not to me. Then again I'm not a software programmer by trade, I'm hardware. Therein probably explains the difference in approach, and it became more apparent in a recent conversation with a friend who is a time served software programmer - he also looked at me strange when I said most/all of my stuff was assembler. But when I explained to him what I do, and that in effect assembler is the closest to writing in terms of the hardware, now he understands. I write from the point of view of the hardware outwards, not a piece of software inwards. The device guides what I do.

    "must I "PAY" for his rescue?"

    No, not at all. But you already have paid by replying to the thread. Granted, there's sometimes a need to steer people toward something that may prove more fruitful for them. But it depends where you are trying to steer them too.

    There's nothing wrong with the OP, but I would say that sometimes people are making assembler much harder to read than it need be, by the style (ie generating a completely new set of label names, when the datasheet has them all beautifully set out already), mixing it with C and C directives, and moreso if it's written in CCS which omits some helpful readable things like MOV32.

    "If we don't properly condemn - have we not encouraged? Can that be good?"
    There's nothing to condemn. I would encourage people to write in assembler IF it suits the task, as it's brutally simple and why complicate the task? For the OP's task of initialising the device it's superb. It also gives me high reliability as I can see all that goes on. Sure you could look at the output of a C compiler and get used to its style but I don't need that angle of it.

    "Really - new year dawns - are we to tear out our: rear view cameras, side/front/rear radar, and lane-deviation alerts - to "welcome" a (far) less efficient/productive past? Few think so - posters SHOULD be advised (discard their horse/buggy) ... ... (or suffer their self-caused pain silently - and alone...)"

    I kind of get what you're saying, but sometimes you speak in riddles cb.
  • Happy new year to you too, Pete.   You prove a most welcome new (contributing - not just taking) addition to this forum.

    I agree w/most all of your points - I'm a hybrid - switching between HW & SW - but as I'm involved w/a small, tech business - efficiency is - by far - key.

    Did you know that - by far - the primary reason this vendor acquired the (past) Stellaris line - was due to the eased/extensive API.   (electronic press - in multiple writings - broadcast this fact)   Any basic read/review of this forum and/or this vendor's products will surely announce this API.   And it has proven itself to be immensely helpful.

    I believe that there is, "something to condemn."  Is not this forum a, "Zero Sum Game" in which the vendor's rep. "Amit" is daily challenged to answer as many posts as he's able?    And - w/each answer - (ideally) should not that serve as a, "Reusable Model" for follow-on forum readers/users?   ASM quite clearly does not meet that objective - for the vast majority - and (usually) will cause more harm than benefit.   (I admit that in your case - such would not (always) prove true - but you are a very distinct minority.)   Thus - Amit's time (or Chester's or yours) spent in helping a very minority user - detracts from that time available to prove of more use to the greater forum community.  (i.e. greatest good for the greatest number)

    The "riddles" you note may stem from my training @ UCLA law - I strive to question rather than assert - and colorful and distinct "contrasts" work in the court-room - and here/elsewhere too.   Writing tech contracts & managing a rapidly growing, small tech firm extracts its price.   My time here serves as learning - helping as/if I can - and my past "selling to show-biz" (color) sometimes intrudes.   Even you, Pete - are "protected" - by my urging of the forum's boilerplate inclusion (down low) of the wording, "Providers of content."   (that's you, Robert, others, I)    If indeed something is unclear - I am well noted for responding.

    I've been @ this and predecessor forum (LMI) from inception - have invested time/energy - and harvested a large block of most excellent client relationships thru these efforts.   (you would not believe the caliber of those present/reading this forum...)

    It is for the greater good that I often, suggest alternatives.   This thread proves no exception - the, "Return on Investment" to this posting will prove minimal..  (as I've past co-founded - served as VP Engineering - then took tech firm public - my comments flow from a record of success - & my desire to be of reasonable use to this community...)

    The somewhat "riddled" post I authored, "What's Unclear" (up top) will (likely) exceed 25K "hits/visits/views" sometime today - and has recorded the fastest hit rate - by far - ever witnessed - this vendor's forums.  Thus - some care/interest/uniqueness in composition - will deliver eyes!  (and verdicts)   (fastest to 10K, 15K, 20K & (sometime today) 25K!)

  • "Happy new year to you too, Pete. You prove a most welcome new (contributing - not just taking) addition to this forum."

    I do like to given back more than I consume. I also like to provoke people into thinking for themselves and being the creators of content.

    "I agree w/most all of your points - I'm a hybrid - switching between HW & SW - but as I'm involved w/a small, tech business - efficiency is - by far - key.
    Did you know that - by far - the primary reason this vendor acquired the (past) Stellaris line - was due to the eased/extensive API. (electronic press - in multiple writings - broadcast this fact) Any basic read/review of this forum and/or this vendor's products will surely announce this API. And it has proven itself to be immensely helpful."

    As I mention further down I'm new to TM4C, so to hear of the some of the history of it is interesting. My path lead me here for the following reasons - I knew that the new MCU that I was about to learn would be ARM based. So I began looking at which one to use, regardless who made it. I came across the TM4C1294 it was obvious it was a capable device. The DMA controller, the ability to use it with almost anything in the device, and things like hardware CRC engine transform it into something that is indeed powerful. Secondly it was easy to get hold of a ready made board for it that I wouldn't class as a toy, like so many are. It has a 98way edge connector which makes it very easy to connect the additional hardware to it. It may, at the moment be unique in that respect. There are too many poor MCU header boards about. Thirdly it is easily modified to remove the (sometimes unstable) ICDI hardware and connect a JTAG programmer. Nowhere did the API come into these decisions, although I can understand that for some they'd be essential. I don't fancy writing a USB or Ethernet stack in Assembler but nor do I need such. If I did I'd look at what the ROM had to offer.

    You mention 'efficiency' and I'm all for it. Mention of such made me add a little to my previous post. C doesn't automatically get you efficiency. No language does. You can write poor software in any language, including English.

    If it's efficiency at porting it then again C isn't a cure-all. At low level, if the original was well written and documented then porting it to another device or even manufacturer usually isn't a problem. Maybe because when things get very complicated I resort to flowcharts and converting flowcharts to assembler is very easy, in fact the chart writes the code for you.

    I think you often have to go higher up the chain for some languages to be truly portable.

    I believe that there is, "something to condemn." Is not this forum a, "Zero Sum Game" in which the vendor's rep. "Amit" is daily challenged to answer as many posts as he's able? And - w/each answer - (ideally) should not that serve as a, "Reusable Model" for follow-on forum readers/users? ASM quite clearly does not meet that objective - for the vast majority - and (usually) will cause more harm than benefit. (I admit that in your case - such would not (always) prove true - but you are a very distinct minority.) Thus - Amit's time (or Chester's or yours) spent in helping a very minority user ..........

    See below as to why I posted what I did and my belief that its use transcends the original poster.

    The "riddles" you note may stem from my training @ UCLA law - I strive to question rather than assert - and colorful and distinct "contrasts" work in the court-room - and here/elsewhere too. Writing tech contracts & managing a rapidly growing, small tech firm extracts its price. My time here serves as learning - helping as/if I can - and my past "selling to show-biz" (color) sometimes intrudes. Even you, Pete - are "protected" - by my urging of the forum's boilerplate inclusion (down low) of the wording, "Providers of content." (that's you, Robert, others, I) If indeed something is unclear - I am well noted for responding.

    Given your legal background cb you will appreciate what I mean when I draw the parallel between discussion here and that of a retiring Jury. Sometimes when a Jury retires, if the verdict is not contentious discussion is minimal, they sit about, eat their food, and the usher comes in after the requisite time for them to deliver their verdict. But when the verdict is contentious you have a much more in depth debate and it's then the real discussion starts. It's much more interesting.

    "you would not believe the caliber of those present/reading this forum..."

    It would not surprise me, and I've seen some superb posts going back several years. There seems to have been a handful of posters, some of which are now quiet, that when they post it's usually 1st class stuff.

    "It is for the greater good that I often, suggest alternatives. This thread proves no exception - the, "Return on Investment" to this posting will prove minimal.. (as I've past co-founded - served as VP Engineering - then took tech firm public - my comments flow from a record of success - & my desire to be of reasonable use to this community...)"

    I think the ROI on this thread maybe hard to quantify, especially if you judge it on only having merits for the Original poster. I had an identical problem with the 4K limit in some addressing modes as to why I think I know what is wrong. It was some kind soul on a group somewhere that bothered to properly explain what was actually going on. That was after about 8 hours of reading as I'd started learning ARM assembler about 2 days before that. That enabled me to properly fix the problem, never see the it again, and have the knowledge to explain it to somebody else in trouble in the future. If the author is so short-sighted as to not bother returning to the thread to even thank people for the help, as some are, then I believe that it will help others regardless. But sometimes it's not easy to know where to draw the line.

    The somewhat "riddled" post I authored, "What's Unclear" (up top) will (likely) exceed 25K "hits/visits/views" sometime today - and has recorded the fastest hit rate - by far - ever witnessed - this vendor's forums. Thus - some care/interest/uniqueness in composition - will deliver eyes! (and verdicts) (fastest to 10K, 15K, 20K & (sometime today) 25K!)

    As Luis said as one of the first posts in the "What's clear" thread, sometimes the stickies get missed. I've missed it too. So I've briefly read the 1st page and yes it's a good idea. But it does make me wonder why TI haven't done this before? 2-3 months back I submitted a list of typos and mistakes in the TM4C1294 datasheet that I have come across to date. It wasn't obvious as to where to submit them to (maybe your thread will assist this). Fortunately I was in contact with TI tech for another reason and the contact offered to pass them on. But why is there not a more visible mechanism to pass them on? Like a lot of forums managing them is the time consuming problem. We are fortunate that this forum exists and we have Amit's, amongst others, assistance. Well, I say fortunate because at the end of the day Amit is an employee of TI and TI exist to sell Silicon, and this is not in any way to undermine Amit's efforts. I for one would not be here if it wasn't for Amit's assistance. It is in TI's interests to ease users' paths into using their devices. They got it right with the easy and cheap EK1294XL launch pad that ACTUALLY breaks out a lot of the IO for use, unlike the TM4C123G which is far less useful for intensive jobs. They got it wrong with the slow datasheet updating. This amazes me as the original version of the datasheet is very good. And despite its size is very readable. But updates are sloooow. This isn't a new problem, it's been going on years from what I've read on this forum. LM3S suffered from the same problems.

    So, TI, why is it so slow to update the datasheet? I appreciate that you have to go through an approvals process, but still, why is it still so slow? This is my first foray into TI MCUs having been a nearly lifelong user of Motorola products. I'm still very happy with their devices, but I always have a look round to see what's new and the TM4C1294 was particularly impressive. But the slow updates are letting it down.

    Why not have a forum sticky, one for each main device, where solutions could be quickly pasted up that haven't reached the approvals stage. Make it clear that they are preliminary, and say only let Amit update the thread. The thread content could literally be pertinent posts that have solved problems in the past, yet to be listed in the data. When I think about the hundreds of threads I've read on here, it is usually only one or two posts that actually offer the solution. Because in some instances that's all the users have to solve problems. The users could search that first, the datasheet updater can run through it to see if contains stuff that needs processing.

    But don't let users update it, it ends up with all kinds of rubbish it.
  • Thank you so much Chester your reply help me so much !! You pointed me to the correct fix, and now I fixed all my project, I made huge modifications to all the project and now it goes without problem.

    I separated in many smaller files and now compiles.

    I had just attached in this reply the project if you want to check or just have a look you're welcome !!

    But, unfortunately I'm still unable to program my launchpad and I still don't understand why.

    In the project I just attached here, in the folder "Release" there is a file whose extension is ".out", but I think to need a ".bin" one to program my launchpad with the LM Flash programmer, can you still help me?

    Now I'm able to program my board in a full compliant assembly, but I'm not able to program it, and I don't undestand why.

    Plesa help me if you can

    Thanks

    TivaM4-Indicizzato-.zip

  • Leonardo Chiodi said:
    In the project I just attached here, in the folder "Release" there is a file whose extension is ".out", but I think to need a ".bin" one to program my launchpad with the LM Flash programmer, can you still help me?

    To create a .bin file for the program add the following command under the CCS Project Properties -> Build -> Steps -> Post-Build Steps:

    "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"

    I just copied this post-build command from one of the TivaWare examples which creates a .bin file.

    Note that after adding a post-build rule to an existing compiled project, you need to perform a project re-build to force the post-build rule to execute for the first time, on subsequent builds the post-build rule will be run automatically.

    Leonardo Chiodi said:
    but I'm not able to program it, and I don't undestand why.

    The .bin file is necessary when using LM Flash Programmer. Since you have a CCS project, a possible alternative is to just start a debugging session in CCS. Starting a debug session causes CCS to program the .out file into flash and start the program running. i.e. starting a debug session avoids the need to create a .bin file.

  • Greetings Leonardo,

    You are of course free to choose any method to program, develop & debug your TM4C application here.    Yet - we note - one week has passed - and your, "ASM caused difficulties" still continue!

    Might you explain your desire for, "Full compliant ASM?"

    Perhaps you've not (yet) noted this (and predecessor) vendors' simply  terrific "API" - programmed in C - which includes hundreds of well detailed programming examples, a dedicated/detailed "Peripheral Driver Library User Guide" and even multiple tutorials upon, "Youtube."

    Indeed there ARE times when, "ASM proves best" - but for the clear majority here - the week-long, "Blood, sweat, tears" example you present - is the "expected" result of ASM.   (or its "brother in crime," DRM.)

    Now my concern is not (entirely) w/you - but w/the vast majority - who (may) choose ASM (or DRM) and then, (with great predictability) "Wash ashore" this forum.   There is just one "Vendor Rep" to save you!   (and poster Chester)   And (both) of their jobs are rendered far more complex, time-consuming, and demanding - due to the (always) unexplained desire to, "Use ASM!"   (or DRM)

    What would become of the forum if many elected ASM (or DRM)?   (such should be considered - should it not?)   Response time would (surely) greatly expand - response numbers would plunge - make NO doubt!   Can that be good?   In light of this (most predictable) result - should ASM or DRM use be encouraged?

    A Tried, True, Tested alternative (the API), "Stands at the Ready" - has been used successfully by many thousands!   (as reported in the electronic press)  ASM (or DRM) proves always - IN TERRIBLE CONTRAST - a risky, "One OFF Adventure" - UNTried, UNTrue, UNTested - can this make sense?

    Again - you are free to choose your "poison" - yet I MUST, "Sound the ALARM"  - and make the (clear) case for the superb (tried/true/tested) API...