XS128 serial flash programming error.

取消
显示结果 
搜索替代 
您的意思是: 
已解决

XS128 serial flash programming error.

跳至解决方案
626 次查看
PadelisGR
Contributor III

Hi,

 

i am working on a serial bootloader for which i dont have the original source code but i can debug it in Codewarrior with USBBDM.

The problem is when it reaches a certain point in the code. In sort it loads 0xF at GPAGE and then it stores a word or byte at the specified location.

On the GSTD or GSTAB instruction the cpu resets. So i have to start from the beginning. Here is the code in assemble language.

 

ORCC     #0X10 LDAB     0x10 PSHB MOVB     #0xF, 0x0010 LDX     0x300E LDD     0x3010 GSTD     0x0, X PULB STAB     0x10 ANDCC #0xEF RTS

 

The cpu resets at the GSTD instruction.

A sort explanation on what the above code does is this,

Store 0xF to GPAGE

Load target address in X and word in D

Save word D at 0xF_xxxx.

 

Can someone suggest something or have an idea on what is going wrong here?

I would expect that the 0xF_3000 is the "global" ram location which is the same as the "logical" ram location which is at 0x3000.

标签 (1)
0 项奖励
1 解答
386 次查看
kef2
Senior Contributor IV

What is stored in memory at 0x300E?  LDX     0x300E  loads X reg from memory @0x300E.


  • I would expect that the 0xF_3000 is the "global" ram location which is the same as the "logical" ram location which is at 0x3000.

You expectations are wrong. See XS128 memory map depicted in Figure 1-2 in XS datasheet. Depending on available RAM size, 4k, 8k or 12k on XS64/XS128/XS256, RAM is available at global addresses 0xF_F000..0xF_FFFF / 0xF_E000.. / 0xF_D000..0xF_FFFF. Table 1-2 in datasheet specifies bottom global address for each derivative, see RAM_LOW column in Table 1-2.

在原帖中查看解决方案

0 项奖励
2 回复数
387 次查看
kef2
Senior Contributor IV

What is stored in memory at 0x300E?  LDX     0x300E  loads X reg from memory @0x300E.


  • I would expect that the 0xF_3000 is the "global" ram location which is the same as the "logical" ram location which is at 0x3000.

You expectations are wrong. See XS128 memory map depicted in Figure 1-2 in XS datasheet. Depending on available RAM size, 4k, 8k or 12k on XS64/XS128/XS256, RAM is available at global addresses 0xF_F000..0xF_FFFF / 0xF_E000.. / 0xF_D000..0xF_FFFF. Table 1-2 in datasheet specifies bottom global address for each derivative, see RAM_LOW column in Table 1-2.

0 项奖励
385 次查看
PadelisGR
Contributor III

0x300E is where the 16bits of the target address are stored.

Your tip really helped me as i moved the target address to the ones that you pointed and it worked. Thank you for your help.

Regards

0 项奖励