FlexBus bus error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FlexBus bus error

Jump to solution
728 Views
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

Labels (1)
0 Kudos
1 Solution
567 Views
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

View solution in original post

0 Kudos
4 Replies
567 Views
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 Kudos
567 Views
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 Kudos
567 Views
kevinhalberg
Contributor II

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

pastedImage_0.png

Kevin

0 Kudos
568 Views
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 Kudos