Hello all,
I've designed my own TM4C123GH6PM CUSTOM BOARD. I missed out the point that PD7 is locked PIN while designing the PCB . So now I want to use UART2 on the custom board.
All other UARTs are working fine. Kindly suggest!
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.
Hello all,
I've designed my own TM4C123GH6PM CUSTOM BOARD. I missed out the point that PD7 is locked PIN while designing the PCB . So now I want to use UART2 on the custom board.
All other UARTs are working fine. Kindly suggest!
Hello Sumit,
Please see Issue #1 from our forum FAQ: https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/374640
Hello Sumit,
The initialization seems fine to me, and if you correctly added the right ISR to the UART2 portion for startup_ccs.c, then I don't have an immediate suggestion on a root cause.
Please refer to our Fault Diagnosis app note to try and find out the root cause of the fault: http://www.ti.com/lit/an/spma043/spma043.pdf
If you get stuck regarding what to do once you've identified the fault, let me know what steps you've taken from the app note and what the results are and I can try to help guide you further then.
Code shown does not establish the fact that,
"SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);" - which is w/in "UART2_INIT"
Executes prior to "Main's" call to, "HWREG(GPIO_PORTD_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;" - which will yield a visit to "Fault ISR."
By "single-stepping" your code - you should be able to identify the "exact location" of, "Entry to the Fault ISR." Your report of such would greatly aid remote diagnostics...
Hello cb1,
Great catch, I didn't recall of the importance of the ordering for the Unlock sequence. Yes, the SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); needs to be called before the Unlock process is executed.
So the proper sequence would be (for the sake of Sumit's full clarity):
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); HWREG(GPIO_PORTD_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY; HWREG(GPIO_PORTD_BASE+GPIO_O_CR) |= GPIO_PIN_7;
And that would then followed by any configuration API's.
Thanks for catching what I failed to :)
Ralph,
Thank you - as always - appreciated.
Your crüe answers "so many" - AND my crack staff (yet never moi...HA!) have made that mistake SO MANY TIMES - it has (almost) stuck!
There's NO failing on your part - poster's "miss" of PD7's (enforced) requirement - (which VIOLATES KISS) - distracted from his, "central goal!" KISS dictates that the "Program's Goal" be met INITIALLY - by the shortest/simplest & most direct means. (i.e. NOT by any port unlocking!)
That simplicity could have been achieved by, "Initially selecting a UART pin NOT BURDENED by "UNLOCK" - getting that to work - and only then using that code (modified to the user's desired port) in conjunction with the (later, added) "Port Unlock."
As proven - yet again - the bundling of code processes "INVITES ERROR!" Instead - confining code build to a single process - one at a time & test/verifying (KISS) always WORKS BEST!