energia / tivac-core

7 stars 17 forks source link

MCU Wrong Definition for EK-TM4C123GXL LaunchPad #24

Closed robertinant closed 7 years ago

robertinant commented 7 years ago

From @rei-vilo on December 19, 2015 22:51

File Energia.app/Contents/Resources/Java/hardware/lm4f/cores/lm4f/Energia.h includes a wrong definition for the EK-TM4C123GXL LaunchPad.

#if defined(__TM4C129XNCZAD__)
#define TARGET_IS_SNOWFLAKE_RA0
#define PART_TM4C129XNCZAD
#elif defined(__TM4C1294NCPDT__)
#define TARGET_IS_SNOWFLAKE_RA0
#define PART_TM4C1294NCPDT
#elif defined(__LM4F120H5QR__) || defined(__TM4C123GH6PM__)
#define TARGET_IS_BLIZZARD_RB1
#define PART_TM4C1233H6PM 
#define PART_LM4F120H5QR
#else
#error "**** No PART defined or unsupported PART ****"
#endif

It should be PART_TM4C123GH6PM instead of PART_TM4C1233H6PM as per ARM® Cortex®-M4F Based MCU TM4C123G LaunchPad™ Evaluation Kit product page.

The TM4C123G LaunchPad Evaluation Kit is a low-cost evaluation platform for ARM Cortex-M4F based microcontrollers from Texas Instruments. The design of the TM4C123G LaunchPad highlights the TM4C123GH6PM microcontroller with a USB 2.0 device interface and hibernation module.

As a consequence, wrong pins are selected in Energia.app/Contents/Resources/Java/hardware/lm4f/cores/lm4f/driverlib/pin_map.h and QEI pins aren't exposed.

Copied from original issue: energia/Energia#807

robertinant commented 7 years ago

From @rei-vilo on December 19, 2015 23:4

capture 2015-12-20 a 00 03 11

robertinant commented 7 years ago

From @spirilis on December 19, 2015 23:29

Fwiw, the part listed "PART_TM4C1233H6PM" correctly corresponds to the Tiva-C branded equivalent for the Stellaris LM4F120H5QR. It's Tiva-C TM4C123G that needs its part entry changed.

robertinant commented 7 years ago

From @rei-vilo on December 19, 2015 23:49

I don't understand. Is the specification sheet of the TM4C123G LaunchPad wrong?

It should be PART_TM4C123GH6PM instead of PART_TM4C1233H6PM as per ARM® Cortex®-M4F Based MCU TM4C123G LaunchPad™ Evaluation Kit product page.

The TM4C123G LaunchPad Evaluation Kit is a low-cost evaluation platform for ARM Cortex-M4F based microcontrollers from Texas Instruments. The design of the TM4C123G LaunchPad highlights the TM4C123GH6PM microcontroller with a USB 2.0 device interface and hibernation module.

The TM4C123G doesn't feature QEI, and I've just tested QEI on TM4C123GH6PM-based LaunchPad successfully.

robertinant commented 7 years ago

From @rei-vilo on December 20, 2015 0:31

The LM4F120H5QR doesn't have QEI...

SysCtlPeripheralPresent SYSCTL_PERIPH_QEI0 0 SYSCTL_PERIPH_QEI1 0

...while the TM4C123GH6PM does feature it...

SysCtlPeripheralPresent SYSCTL_PERIPH_QEI0 1 SYSCTL_PERIPH_QEI1 1

...thanks to this very basic sketch based on 16.2.1.23 ROM_SysCtlPeripheralPresent from LM4F120H5QR ROM USER’S GUIDE (spmu245a).

#include "Energia.h"
#include "driverlib/sysctl.h"

void setup()
{
    Serial.begin(9600);
    delay(250);
    Serial.println("SysCtlPeripheralPresent");

    Serial.print("SYSCTL_PERIPH_QEI0\t");
    Serial.println(SysCtlPeripheralPresent(SYSCTL_PERIPH_QEI0));
    Serial.print("SYSCTL_PERIPH_QEI1\t");
    Serial.println(SysCtlPeripheralPresent(SYSCTL_PERIPH_QEI1));
}

void loop()
{
}
robertinant commented 7 years ago

From @rei-vilo on December 20, 2015 0:52

At the same time, Energia.app/Contents/Resources/Java/hardware/lm4f/variants/stellarpad/part.h defines for LM4F120H5QR- and TM4C123GH6PM-based LaunchPad...

#define __LM4F120H5QR__
#define __TM4C123GH6PM__

...but Energia.app/Contents/Resources/Java/hardware/lm4f/cores/lm4f/Energia.h doesn't converted __TM4C123GH6PM__ into PART_TM4C123GH6PM, hence the issues I'm facing with QEI for example.

However, Energia lists the 2 boards.

capture 2015-12-20 a 01 53 20
robertinant commented 7 years ago

From @rei-vilo on December 20, 2015 0:58

The previous sketch identifies 1 QEI for the TM4C129ENCPDT aka. Connected LaunchPad.

SYSCTL_PERIPH_QEI SYSCTL_PERIPH_QEI0 1 SYSCTL_PERIPH_QEI1 0

robertinant commented 7 years ago

From @rei-vilo on December 20, 2015 1:15

The boards flags defined by Energia 0101E0017 are

robertinant commented 7 years ago

Fixed