TI E2E Community
Hercules™ Safety Microcontrollers
Hercules™ Safety Microcontrollers Forum
RM48 SPI4 Loopback Problem
I'm using the RM48L950 PGE with HALCoGen and IAR and I can't seem to get the loopback test for SPI4 to work.
I can transmit out of SPI4, verified with the oscilloscope but when I either solder the MOSI and MISO lines together or enable the Digital Loopback, the only thing I receive (polling method), is 0xFF.
Thanks for your post. We will look into this and get back to you
Herules support forum
On RM48L950 the SPI4 is multiplexed with NHET1 pins.Out of reset, the default function is NHET1, so in order to use the SPI4 you have to program the Pin Mux Module.
This is available in HalCoGen using the tab "PINMUX"On the top of the screen you will see an Enable/Disable Peripheral check boxes. You will have to check the box for SPI4.It is always recommended to click on the List Conflicts button to check that your configuration is valid.
Of course once the SPI4 is used, the corresponding NHET pins are no more usable as NHET.
If my reply answers your question please click on the green button "Verify Answer".
That was one of the first things I checked. Hence why I have transmit working.
To reiterate, in HALCoGen, I have the SPI4 peripheral checkbox checked under the PINMUX tab.
Any further ideas?
I've done an SPI loopback on the RM48 HDK board using the SPI2 code for SD cards.
I've nearly copied the spiInit() code for SPI2 into SPI4's init on my board, making adjustments for the different clocks on each board, yet when I connect the MOSI and MISO lines together and use the SPI_send command the only thing I get back is 0xFF.
I've again verified on the scope that I see the transmit data on the microcontroller pin ( pin 31 on the RM48L950 PGE )
What happens during spiInit() if the SPI4ENA pin is not driven low?
The state of the spi pins have no effect on the spiInit().
In HalCoGen, to use multiple SPI/MIBSPI, you have to check box the one you plan to use in Driver Enable tab.Than HalcoGen will generate the spiInit() routine. There is only one spiInit() routine that will take care of all the SPI/MIBSPI you plan to use in your application.
SPI4 in checked under the Driver Enable tab in HALCoGen and the spiInit() is being used.
I've also now reproduced the problem on the HDK. I set the spiInit settings for SPI4, set the SPI4 pinmux using the sample code functions, changed the SPI_send() function to use SPI4, and commented out the hetInit.
I jumpered NHET102 to NHET105 on the HDK, SPI4SIMO and SPI4MOSI respectively, checked the transmission with the oscilloscope to see that I was sending 0xA2, and what I get in response is 0xFF. I even try this loop 10000 times and it's always 0xFF
Attached is the code that I've been running, for your edification.
5751.RM48 Hercules Demo.zip
The customer has contacted us stating that he still needs assistance with this inquiry.
Any assistance you can provide is greatly appreciated.
James Rose Jr.
Quick question , what version of HDK are you using RevD or RevE.
I am guessing you are using "Rev D" In which LED2 ( Tricolour) is controlled with ( NHET1 pin 2, 5 and 20) unfortunately NHET1 Pin 2 and 5 are muxed with SPI4 SIMO and SOMI. Could this be any reason for your failure ? Please check.
~~~ If a post answers your question, please mark it with the"Verify Answer" button. ~~~RegardsPrathap
I'm not at the office right now, I will check on Monday. When I do, how will I tell which Rev it is? Where is it documented?
Also, I know that the SPI4 is pinmuxed with the HET. This is in the RM48 ZWT documentation as such. In the code I uploaded I disable the hetInit() and after all the other initializations I set the SPI4 mux setting with the Gladiator commands.
Is there somewhere else I need to change mux settings? Gladiator_PINMUX_DEFAULT() is not run in the sys_main (unless it's in some other function of course).
The Rev info is printed on the Board. Check right side of " Hercules Texas Instruments" silk screen.
From where did you get this peice of code ( Demo) ? Did you download form TI website?
You can use HALCoGen 3.01.01, which will help you to resolve your problem quicker.
I can't tell you the exact directory structure right now, but this is supposed to be the source code for the Hercules Safety MCU demo. I either downloaded it or it came on the CD with the HDK.
I've tried using HALCoGen 3.01.01 and CCSv5.1 with the HDK and I either get a memory loading error or when I use any of the .cmd files with the project (either the sys one from HALCoGen, or the RM4 or TMS570 ones from the TI folders) I get overlapping memory errors.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.