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.

u-boot freeze when interrupts are activated

Hello friends,

I need to send some SPI data to my custom LCD ( all in u-boot context). Now the first option I tried to enable the SPI 1 hw peripheral of AM335x (instead of bit banging on GPIO) using SItara Ware examples. But when enable interrupts, the u-boot just freeze, never enters in prompt.

    139 void CPUirqe(void)
    140 {
    141     /* Enable IRQ in CPSR */
    142     asm("    mrs     r0, CPSR\n\t"
    143         "    bic     r0, #0x80\n\t"
    144         "    msr     CPSR, r0");
    145 }

I don't have a JTAG so I cannot see where AM335x is blocked.
Any hints appreciated,

  • Do you mean Starterware? The latest Linux SDK has support for SPI boot and reading/writing SPI flash. You should start based on this and modify according to your needs (http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide#SPI_2)

  • Yes Starterware :)

    I don't use PSP (yet) since the BSP isn't working well on my BSP. I just clone u-boot from it's repository and configure for AM335x (since it's quite well supported) + some patches for BBB (BeagleBone Black).

    But I'm stuck on using SPI 1 module from AM335x which I intend to use in u-boot for my own purpose, not for booting process.

  • Hi,

    Where are you making your changes? The am335x boards use the omap3_spi.c driver for SPI communications. You can check the API inside.

    Please read the <u-boot_dir>/doc/driver-model/UDM-spi.txt document on how to use the SPI API.

    Best regards,
    Miroslav

  • I know u-boot has many drivers and I will check SPI one but during testing, I noticed the newly LCD driver I already use, which supposed to use interrupts, isn't working as expected.

    The problem noticed is interrupts arn't working at all and right now I don't know why. This issue came up when playing with SPI driver.

    Ok, I'll investigate more and come back with updated results.

  • Ok, the problem is more complicated that I thought. Basically, u-boot doesn't use interrupts, the #defines were completely removed from configure, must be added by hand:

    #define CONFIG_USE_IRQ
    #define CONFIG_STACKSIZE_IRQ    4096
    #define CONFIG_STACKSIZE_FIQ    4096

    But several irq <arch> functions must be implemented, at least for AM335x so in my case, it's just don't worth.
    I'm sure we can still use MCSPI peripheral and pool some flags to complete like in any MCU since I only need few dozens of bytes to be transferred once to LCD.

    So when IRQ's were enabled (forced by my code), the core actually jumped but probably at missing vector table or so...

    Best regards,

    Edi