I use MIBSPI1 of TMS570LS3137, when I want to send N bytes ,it always send 8 16bit bytes ,no matter I send N<8 or N>8 ,why ?
I tried the example of HDLCOGEN ,the result is the same
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.
I use MIBSPI1 of TMS570LS3137, when I want to send N bytes ,it always send 8 16bit bytes ,no matter I send N<8 or N>8 ,why ?
I tried the example of HDLCOGEN ,the result is the same
Hi Jiaming,
Can you pls send your project file or atlesa the HALCoGen project file for reference. ( .dil and HCG)..
Regards
Prathap
Jiaming,
You must configure length of Transfer group to be 127 to get all your 127 data's to go out.
This can be found in MIBSPI1 trasfer group TAB setting.
Again there are multiple ways you can configure MIBSPI to work with DMA, you might have to figure out your use case and do it accordingly. Let me know if you need with your specific case, i can get you a sample code.
Regards
Prathap
thank you for your reply, if i want to send different length bytes , i have to change the length before I sending the bytes?Because i find if the bytes number is smaller than the length , the rest bytes isfilled with 0,and TMS570 sends out the rest 0 ,I don't want to send these 0.
Jiaming,
Again this can be configured multiple ways, the catch is how you trigger DMA through MIBSPI.
Let me know below used case id good for you I will do a sample code.
You wanted to transmit data like 10 Words after some time 20 Words, after some time 30 Words to the same slave through MIBSPI1 using DMA.
Regards
Prathap
yes ,you are right. I want to send different number words.The demand is not confirmed now.
May be I need sendding 120 words and 10words.And we need interrupt to inform CPU that the words is sent completely.
Please give me example and the use of HALCOGEN.
Thank you
Jiaming,
Please find the attached your Project modifed to run MIBSPI + DMA for varying Length. 7635.ls_TI.zip
Again this is one type of Config I used, Based on the used case this can be optimized..
I used one Transfer Group with 1 buffer only. DMA is controlling the complete data transfer.. I did a loopback so that both TX and RX DMA can be demonstrated.
I do not have KEIL tool with me so I changed your HALCoGen project to Texas Instruments, Please go to HALCogen open the project, choose Tools --> ARM Tools and generate the code again for you to use.
Note: You see again and Again DMA config, the reson is I have used AUTOINIT_OFF. Because for my used case it is required since MIBSPI will never stop triggering DMA, once it starts to avoid unwanted data transfer i have used AUTOINIT_OFF.
Regards
Prathap
Thank you for your project. It works now.
But I have some other questions.Maybe because I use Keil .I can't find "_enable_IRQ();" I use other asm files to make project work.
I want to use the files created by HALCOGEN.How can I find function like "_enable_IRQ();" with Keil?
Hi Jiaming,
Oops it was TI library function to enable ARM interrupt. HALCoGen too have similar function.
You can replace it with _enable_interrupt_(); and include sys_core.h in the main file.
Regards
Prathap
I want to know why did you use rx interrupt to set flag=0xaaaa5555?
I tried to modify the interrupt for tx:
//dmaEnableInterrupt(DMA_CH1, BTC); //delete it
dmaEnableInterrupt(DMA_CH0, BTC); //tx
At notification.c ,I have changed into :
if( channel = DMA_CH0)
/* Set flag to indicate Interrupt */
DMA_Comp_Flag = 0x5555AAAA;
In this case ,only first 120 characters can been sent ,why?
Hi Yunfeng
I have configured for Loopback with both TX and RX DMA. There are chances that you might be disabling TX and RX DMA request before the last data if TX DMA service is used, so there might be a Overrun condition.
It's more cleaner to wait until RX is complete. On top I have configured MIBSPI BUFMOD as wait until TXFULL and RXEMPTY