AnsweredAssumed Answered

How does PE generate code from the config file.

Question asked by Andrew Parlane on May 21, 2014
Latest reply on Aug 22, 2014 by Marek Neuzil

Hi, I'm having some problems getting DMA to work both with serial and SPI.

 

I am using the K20D50-FRDM board, hand referring to the "K20 Sub-Family Reference Manual, Rev. 2, Feb 2012" documentation.

 

For the DSPI peripheral I see that it can either generate interrupts or DMA requests which makes sense, based on the value of TFFF_DIRS and RFDF_DIRS bits in the SPIx_RSER register. I see no options in the Component inspector for the SPIMaster_LDD relating to DMA. If I were using eCos my next approach would be to look at the generic driver code, see if there's anything that sets these bits and check what the #ifdef it was inside, then look up where that gets defined, and figure out how it maps to the config file. With PE I haven't found anyway of doing this.

 

If it was just about those bits though, I could use the PDD functions to set them, and all would be fine. However the driver is set up to only enable interrupts (and I think this includes DMA requests) once you call SendBlock. Which requires a buffer and data, but that should be sent through the DMA component and not through the SPI one, or the SPI component should be configured to pass it on to the DMA code. Nothing of the sort is in the generated code.

 

Not to mention that the SPI driver is kind of crap, the peripheral has a FIFO for Tx and Rx Which can store 4x 16bit values. The default driver however just pushes one byte at a time. The only way I can see to improve this is to copy the generated code and add to it, and not have it auto generated any more. Which is pretty annoying, because then I can no longer change the clock config or other options through the config file, I have to go dig through the registers and find how to change it manually. Nor will PE track which pins are being used, and therefore it won't warn me if I try to use the same pins for another component. All of this I can work around but it would be so much better if I could just edit the template for the code.

 

Am I completely missing the point here, is there a simple solution to all of this? I found "IO_Serial.int" in "C:\Freescale\PExDrv v10.3\eclipse\ProcessorExpert\Beans\Bareboard" which shows me where the config options come from. However when I search in all file in C:\Freescale for "HAL_UART_TStopBitLen" the value in the "Name" field for the stop bit length config option, I found 0 instances except for in that file (the one in the Name field, and one in the PreparedHint field).

 

Any help would be appreciated,

Andrew

Outcomes