FlexBus bus error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,089件の閲覧回数
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 解決策
928件の閲覧回数
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 返答(返信)
928件の閲覧回数
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 件の賞賛
返信
928件の閲覧回数
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 件の賞賛
返信
928件の閲覧回数
kevinhalberg
Contributor II

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

pastedImage_0.png

Kevin

0 件の賞賛
返信
929件の閲覧回数
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 件の賞賛
返信