cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to establish SPI communication between stm32f4 discovery board and AEK-LED-21DISM1 (L99LD21 high power led) . I am just able to read some data but not able to write any data to control register. Can anyone suggest me how to proceed?

Ssuja.1
Associate II
 
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Max VIZZINI
ST Employee

Hi Sujanya,

It is definitely possible to use STM32 with L99LD21 (AEK-LED-21DISM1). My point was that the driver is ready for SPC5 while you have to write it for STM32.

At this point, if you are forced to use STM32, the easiest way is to start from the driver written for SPC5 available in source code in SPC5Studio and port it on STM32. Clearly, you will have to change all the low level calls to the MCU peripherals and properly allocate the microcontroller pins.

Porting should be faster the re-writing it from scratch.

I hope it helps.

Best Regards,

AutoDevKit Team

View solution in original post

4 REPLIES 4
Max VIZZINI
ST Employee

Hi,

We follow SPC5 microcontroller therefore we do not have the source code for STM32.

I can suggest to check the two following key points:

  1. The proper setting of the SPI protocol. In SPC5Studio you can see all the protocol exact timing and conditions, while in STM32, if I am not mistaken, you should be able to select one the available modes.
  2. The L99LD21 requires an active watchdog (timer) that toggles a bit in L99LD21 register with a proper frequency (as specified in the datasheet). If this feature is not properly set, the device will enter a safe mode called limp home where most of the chip features are disabled. This watchdog feature is automatically activated once you allocate the pins for the AutoDevKit components for L99LD21 (AEK-LED-21DISM1) in SPC5Studio.

Being L99LD21 an automotive-grade and automotive compliant product, writing the driver is not too trivial...

Would you not consider to use a small micro like SPC582B for your project? In this way, you can just allocate the AutoDevKit component for the AEK-MCU-C1MLIT1 demoboard. At this point you get the driver ready and can focus only on your application development.

I hope it helps.

Best Regards,

AutoDevKit Team

Thank you for your reply and for providing valid information.
I cannot use SPC582B microcontroller because of some restrictions in our design.
Is it using STM32 to control L99LD21 requires writing our own drivers which is not that easy to write?
Whether STM32 is compatible with AEK-LED-21DISM1 are not?
Please help me out.
Regards
Sujanya
Max VIZZINI
ST Employee

Hi Sujanya,

It is definitely possible to use STM32 with L99LD21 (AEK-LED-21DISM1). My point was that the driver is ready for SPC5 while you have to write it for STM32.

At this point, if you are forced to use STM32, the easiest way is to start from the driver written for SPC5 available in source code in SPC5Studio and port it on STM32. Clearly, you will have to change all the low level calls to the MCU peripherals and properly allocate the microcontroller pins.

Porting should be faster the re-writing it from scratch.

I hope it helps.

Best Regards,

AutoDevKit Team

Hi,
Thank you for the response.
I imported all the driver files and tried adding stm32cubeIDE functions , but few functions are not available in stm32.
It is getting difficult even to port.
I think ,I will have to drop the idea of using stm32.
Regards