FlexBus bus error

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

FlexBus bus error

跳至解决方案
1,095 次查看
kevinhalberg
Contributor II

I am hooking up an LCD to a K65 uC and using KDS with PE setup to interface with the FlexBus.  Every time I try to access the address of the port to send data to the LCD controller i get a bus error.  What could be wrong?

Thanks in advance,

Kevin

标签 (1)
0 项奖励
回复
1 解答
934 次查看
kevinhalberg
Contributor II

It looks like I have this working now.  I had to manually set the CSR0 V flag even though CS0 was enabled via PE.

Kevin

在原帖中查看解决方案

0 项奖励
回复
4 回复数
934 次查看
kevinhalberg
Contributor II

Looking at the assembly code for the line *((uint16_t *)DISPLAY_ADDR_CMD = 0x29;  Where DISPLAY_ADDR_CMD is 0x6000000 it looks like it is branching right at the strh and it goes to the WDOG_EWM_IRQHandler at 000004e8, and for the 'C' debugging it shows that it went to the DEFAULT_ISR.

It also looked like the error was a imprecise bus error from the uC registers.

I am currently debugging this today and would love any help you could provide.

Kevin

0 项奖励
回复
934 次查看
kevinhalberg
Contributor II

Here is the code that I am using to write to the Flexbus LCD controller. 

LCDCommand(0x29);

Here is the function:

void LCDCommand(uint16_t cmd)

{

       *((uint16_t *)DISPLAY_ADDR_CMD) = cmd;

}

Here is the assembler code.  The branch to WDOG_EWM_IRQHandler happens at the 000019c2 address which is right after the strh command that should write the 0x29 value to 0x6000000.

LCDCommand:

000019b0: push {r7}

000019b2: sub sp, #12

000019b4: add r7, sp, #0

000019b6: mov r3, r0

000019b8: strh r3, [r7, #6]

73           *((uint16_t *)DISPLAY_ADDR_CMD) = cmd;

000019ba: mov.w r3, #1610612736   ; 0x60000000

000019be: ldrh r2, [r7, #6]

000019c0: strh r2, [r3, #0]

75        }

000019c2: adds r7, #12

000019c4: mov sp, r7

000019c6: ldr.w r7, [sp], #4

000019ca: bx lr

78        {

Kevin

0 项奖励
回复
934 次查看
kevinhalberg
Contributor II

Here is the configuration of the Flexbus PE component.  Does anyone see anything wrong here?

pastedImage_0.png

Kevin

0 项奖励
回复
935 次查看
kevinhalberg
Contributor II

It looks like I have this working now.  I had to manually set the CSR0 V flag even though CS0 was enabled via PE.

Kevin

0 项奖励
回复