Page 1 of 1

New Ports and SPI2, and SPI3 - Crashing

Posted: 18 Aug 2015 21:28
by thiagoalberici
First of all, I made a program to test the digital ports of my LM4F232H5QD on my EasyMx PRO v7 for Stellaris ARM.
I was careful to:
Leave out the doors PC0, PC1, PC2 and PC3, used by JTAG;
Unlock, by software, the locked doors PD7 and PF0;
Took care of the adaptations of PB6-PK6, PB7-PK7, PD0-PN0, PN1-PD1, PD2-PK4, and PD3-PK5 doors;
The test was a success, all the LEDs blink.

Now, for a second test, I used a clickboard (ETH click).
I declared it in _GPIO_MODULE_SPI0_A245. I tested the Ethernet module in parallel with the other ports (digital) with the blinking LED.
Everything working again.

However, when I repeated the second test, changing the click board to _GPIO_MODULE_SPI2_H467 and to _GPIO_MODULE_SPI3_H023, the processor crashed.
Some tests revealed that if I have something declared in SPI2 and SPI3, with led blinking, the processor crashes.
The crashes happend in the moment that I changed the status of any of the adapted ports (PB6-PK6, PB7-PK7, PD0-PN0, PN1-PD1, PD2-PK4, PD3- PK5).
If I comment the change of status of those doors, everything works again.

Why canĀ“t I use the PB6-PK6, PB7-PK7, PD0-PN0, PN1-PD1, PD2-PK4, PK5-PD3 doors as digital in parallel with SPI2 or SPI3?

Thanks. Att,

Re: New Ports and SPI2, and SPI3 - Crashing

Posted: 27 Aug 2015 14:08
by thiagoalberici
Any thoughts?

Re: New Ports and SPI2, and SPI3 - Crashing

Posted: 28 Aug 2015 16:14
by aleksa.jovanovic
Could you send me both project variants so I can see it working and not working?

Best regards,
Aleksa

Re: New Ports and SPI2, and SPI3 - Crashing

Posted: 04 Sep 2015 20:45
by thiagoalberici
I'm sending you a single project to test both things.
One sec after the beginning, i start blinking a led on a old port (PA0) and nothing happens.
After 3 seconds, i set some new port (PK or PN) and it crashes.
The code is commented...

Thank You for the attention,
[]s

Re: New Ports and SPI2, and SPI3 - Crashing

Posted: 07 Sep 2015 16:46
by aleksa.jovanovic
Try putting it like this

Code: Select all

SPI3_Init_Advanced(1000000, _SPI_MASTER, _SPI_8_BIT, &_GPIO_MODULE_SPI3_H023);
  //Old Port as Digital
  GPIO_Digital_Output(&GPIO_PORTA_DATA_BITS, _GPIO_PINMASK_0);//PA0
  //New Ports as Digital
  GPIO_Digital_Output(&GPIO_PORTK_AHB_DATA_BITS, _GPIO_PINMASK_6);//PB6_PK6
  //SPI3 on H023
So the SPI init is before the GPIO functions.

See if it works and report back.


Best regards,
Aleksa

Re: New Ports and SPI2, and SPI3 - Crashing

Posted: 08 Sep 2015 22:19
by thiagoalberici
Hi there, i changed the order like you said (first the spi and then the digital ports) and it works!
First, thanks for the solution! But, any ideas why does the order matter?
Where did you came with this solution from?
Best regards,

Re: New Ports and SPI2, and SPI3 - Crashing

Posted: 09 Sep 2015 08:38
by aleksa.jovanovic
Hi,

Honestly it was a trial and error kind of thing.
The SPI init does something to those ports, which we've monitored in debug mode,
but couldn't figure out yet. We will see through it.

Best regards,
Aleksa