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,
New Ports and SPI2, and SPI3 - Crashing
-
- Posts: 69
- Joined: 04 Jul 2012 12:52
Re: New Ports and SPI2, and SPI3 - Crashing
Any thoughts?
- aleksa.jovanovic
- Posts: 526
- Joined: 30 Jun 2015 08:48
Re: New Ports and SPI2, and SPI3 - Crashing
Could you send me both project variants so I can see it working and not working?
Best regards,
Aleksa
Best regards,
Aleksa
-
- Posts: 69
- Joined: 04 Jul 2012 12:52
Re: New Ports and SPI2, and SPI3 - Crashing
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
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
- Attachments
-
- Spi3_NewPorts Stellaris LM4.rar
- (221.75 KiB) Downloaded 225 times
- aleksa.jovanovic
- Posts: 526
- Joined: 30 Jun 2015 08:48
Re: New Ports and SPI2, and SPI3 - Crashing
Try putting it like this
So the SPI init is before the GPIO functions.
See if it works and report back.
Best regards,
Aleksa
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
See if it works and report back.
Best regards,
Aleksa
-
- Posts: 69
- Joined: 04 Jul 2012 12:52
Re: New Ports and SPI2, and SPI3 - Crashing
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,
First, thanks for the solution! But, any ideas why does the order matter?
Where did you came with this solution from?
Best regards,
- aleksa.jovanovic
- Posts: 526
- Joined: 30 Jun 2015 08:48
Re: New Ports and SPI2, and SPI3 - Crashing
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
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