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.

Beagle Bone (white) LCD Init problem when using Starterware

Other Parts Discussed in Thread: AM3359

Hi,

I have been trying to init the LCD registers using the starterware packages  on the beagle bone. Accrding to the AM3359 Technical Reference Manual the first step is to write the value 0x00000007 to register (LCDBASE+0x6c). I use the following line of C Code:

*(unsigned int *)(0x4830E000+0x6c) = 0x00000007;

The processor immediately aborts after or during this instruction. Have tried the same syntax but using he GPIO registers and the processor is happy.

At first I thought it may be due to the CCS debugger etc, so loaded the code via the SD card. Same result, processor aborts.

Have also tried uing volatile keyword and the HW_REG(....) macro. Same result. Any ideas?

Thanks

Graeme

  • Graeme,

    Have you configured the peripheral clock to the LCDC first? If you look in the starterware examples you should see a function called LCDModuleClkConfig(); that sets up the LCDC peripheral clock within the PRCM.

    Regards,

    Tyler

  • Hi Tyler,

    Great thanks. That seems to have done the trick for the situation when I am not using the debugger or CCS (just compiling from command line).Thanks again.

    However, it seems when using CCS and the debugger(on board BB), I am now getting intermittent success. For instance, when viewing the registers (of most peripherals) i get a message in red saying "Unable to read register". Sometimes the registers can be read, other times not. Also, when writing the LCD registers (after enabling LCD clock), intermittently it seems to crash (either the processor or debugger not sure which).

    Changing clocks while debugging on ARM9 (admittedly these were the core clocks and the clocks that the debugger relied on) caused similar crashes in the past for me on other IDEs but only while stepping through the code.

    Is it possible that enabling these clocks could cause this behaiour in CCS, when enabling the LCD clock?

    On this forum there was another post relating to "Unable to read registers while debugging" a few weeks ago, but from what I can see there was no solution to that problem. It seems similar to the one I am having now on CCS

    Thanks

    Graeme

  • Graeme,

    If you try to access peripherals that haven't been initialized and enabled then you will see the red text saying that it's unable to read. Also, it's possible that your debugging session will crash if you try to interact with peripherals that aren't enabled.

    -Tyler

  • Hi Tyler,

    Thanks again. Seems I need to do a hard reset on beagle bone between debug sessions. Seems its the MMUConfigAndEnable(); function at the start at main that gets confused unless I physically press the reset button on the board. Maybe the MMU unit does not like been configured twice.

    Regards

    Graeme

  • Hi Graeme

    Does BeagleBone-AM3359 has MMU on board ?

    I found nothing MMU specific in BeagleBone reference manual and schematic as well. can u help me solving this confusion .

    Thanks

    Satyaprakash

  • Hi Satyaprakash,

    The MMU from what I understand is contained within the Cortex A8 core (core of the AM3359).

    Documentation on the MMU will therefore be found in the Cortex-A8 Technical Reference Manual from ARM.

    Here is a quick reference to software accessible registers. These are normally accessed by CP15 type instructions. There is a mmu.c file in some of the eaxample starterware projects  ("system/mmu.c")

    http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/kihAsZfdS5wTMO.html

    Hope this helps

    Regards

    Graeme

  • Hello Graeme

    Thanks for ur effort. But Apart from that can u guide me a little in resolving some basic doubts. Below is my doubt.      

    Based on the AM335x data-sheet, AM3359 core is divided into two sections. One is above L3/L4 interconnect(L1,L2,ROM,RAM,SGX,Raster) and another is below (Searial,System,DDR...etc).And it is obvious L3/L4 configuration required when the core needs access below L3/L4 part.

    Presently am using AM3359 based BeagleBone and size of my executable "app.out" is 3.26MB, i assume when am loading app.out, it is going into internal RAM of size 64k, but 64k is very less memory in compared to 3.26MB and even a shared RAM of same size is present but i dont know how to make that work , and i am not sure is that possible to use both Internal & shared RAM for a single executable. Even if it is possible still it is less for my 3.26MB data...is that correct ?

      Then here comes DDR2/3 which is having enough size for my executable, but i am doubtful how to use DDR memory and if am using DDR memory , that means am skipping internal/shared RAM..is that okay to skip ?            And to use DDR, do i have to configure and set L3/L4 bus...? how?

        Thanks

    Satyaprakash

  • Hi Satyaprakash.

    I am a little new to this processor, but will try and answer. If you look at the linker scripts or linker map for the gpioLEDBlink example, the program is linked to run at address 0x80000000 which is the start of DDR memory. The .text(code), .bss , .const etc are all linked to this address, so it seems internal SRAM is not being used.

    When I load my app from SDCard, there is a bootloader which copies my app into memory (probably DDR). I suspect that bootloader will be doing all the DDR inits. Maybe worth looking at that bootloader code(part of starteware to see how the DDR is being initialised).

    Kind regards

    Graeme

     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .text:Entry
    *          0    80000000    000000d4     
                      80000000    000000c8     system.lib : init.obj (.text:Entry)
                      800000c8    0000000c     rtsv7A8_A_le_eabi.lib : auto_init.obj (.tramp.__TI_auto_init.1)

    .text      0    800000d4    0000667c     
                      800000d4    00001d08     drivers.lib : uart_irda_cir.obj (.text)
                      80001ddc    00001998     utils.lib : uartStdio.obj (.text)
                      80003774    00000b50     drivers.lib : gpio_v2.obj (.text)
                      800042c4    00000778     gpioLEDBlink.obj (.text)
                      80004a3c    00000638     utils.lib : ascii.obj (.text)
                      80005074    00000488     system.lib : cp15.obj (.text)
                      800054fc    000003e4                : interrupt.obj (.text)
                      800058e0    00000280     utils.lib : consoleUtils.obj (.text)
                      80005b60    00000270     platform.lib : uart.obj (.text)
                      80005dd0    000001a0                  : gpio.obj (.text)
                      80005f70    00000180     rtsv7A8_A_le_eabi.lib : memcpy32.obj (.text)
                      800060f0    0000014c     platform.lib : uartConsole.obj (.text)
                      8000623c    0000010c     system.lib : exceptionhandler.obj (.text)
                      80006348    000000f4     rtsv7A8_A_le_eabi.lib : u_div32.obj (.text)
                      8000643c    000000d4                           : auto_init.obj (.text)
                      80006510    000000b0                           : memset32.obj (.text)
                      800065c0    00000084     system.lib : startup.obj (.text)
                      80006644    00000080     rtsv7A8_A_le_eabi.lib : cpy_tbl.obj (.text)
                      800066c4    00000060     system.lib : cpu.obj (.text)
                      80006724    00000020     rtsv7A8_A_le_eabi.lib : icall32.obj (.text)
                      80006744    0000000c     system.lib : cpu.obj (.text:CPUIntStatus)

    .bss       0    80006750    00000201     UNINITIALIZED
                      80006750    00000200     system.lib : interrupt.obj (.bss:fnRAMVectors)
                      80006950    00000001     utils.lib : consoleUtils.obj (.bss)

    .const     0    80006954    00000054     
                      80006954    00000038     system.lib : startup.obj (.const:vecTbl)
                      8000698c    00000014     utils.lib : uartStdio.obj (.const:.string)
                      800069a0    00000004     system.lib : startup.obj (.const)
                      800069a4    00000004     utils.lib : uartStdio.obj (.const)

    .data      0    800069a8    00000040     
                      800069a8    00000038     gpioLEDBlink.obj (.data:txArray)
                      800069e0    00000008     gpioLEDBlink.obj (.data)

    .stack     0    87fffff0    00000008     UNINITIALIZED
                      87fffff0    00000008     --HOLE--