Teensy 3.6 on Arduino vs MCUXpresso IDE (not working on MCUXpresso)

Status
Not open for further replies.

ig-or

Active member
Hello!
I'm very new in Teensy programming (this is my first project with it).
I have following question:

I'm using Teensy 3.6, and following very simple sketch on Arduino: everything is working perfectly (LED is blinking)

Code:
volatile unsigned int count;
int k;

void setup() {
 k = 0;
  pinMode(13, OUTPUT);
  pinMode(21, OUTPUT);
  count = systick_millis_count;
}

void loop() {
    digitalWriteFast(13, HIGH);
    digitalWriteFast(21, HIGH);
    count = systick_millis_count;
    while ((systick_millis_count - count) < 1000) {        k++;  }

    digitalWriteFast(13, LOW);
    digitalWriteFast(21, LOW);
     count = systick_millis_count;
    while ((systick_millis_count - count) < 1000) {        k++;  }
}

Now I'm trying to make it using MCUXpresso IDE (nothing is working):

Code:
#include "WProgram.h"

int main(void)
{
	int k = 0;
	pinMode(13, OUTPUT);
	pinMode(21, OUTPUT);
	volatile unsigned int count = systick_millis_count;
	while (1) {
		digitalWriteFast(13, HIGH);
		digitalWriteFast(21, HIGH);
		count = systick_millis_count;
		while ((systick_millis_count - count) < 1000) {        k++;  }
		digitalWriteFast(13, LOW);
		digitalWriteFast(21, LOW);
		count = systick_millis_count;
		while ((systick_millis_count - count) < 1000) {        k++;  }
	}

	return 0;
}

For MCUXpresso, I'm using "teensy\avr\cores\teensy3" files, and compiler-assemler-linker settings from teensy\avr\boards.txt file.
The compilation goes without any errors. After the compilation I do the "conversion into HEX" file using internal MCUXpresso utility, and load this hex file into Teensy 3.6, using Teensy loader 1.40.
Since led is not blinking and no any new COM port on PC side, I suspect that something very important is missing (and/or my program just not starting).
What could be the reason of this issue, and how can I debug it?
Looking forward for the reply.


Best regards, Igor
 
I don't know anything about MCUXpresso.

But I can tell you Arduino has a File > Preference menu, which allows you to turn verbose info while compiling. That will let you see all the compiler commands Arduino is actually running. The first part are not actually compiling code, but merely running "gcc -E" to detect library dependencies, so keep that in mind while reading through the long output of commands it ran.

Maybe if MCUXpresso has some similar way to show you what it's really doing, you might be able to compare the two and figure out what MCUXpresso isn't doing the same as Arduino?

Or if MCUXpresso has a forum or mail list, maybe ask them for help?
 
You can also put the Arduino IDE into "external editor" mode, from File > Preferences.

Many people who prefer to edit in other software do this. In fact, I do it for most projects. Arduino put its own editor into read-only mode, and then reads all the files every time to compile.

I suppose if you just absolutely can't use Java or the Arduino IDE at all, then this may not be so appealing. But if you only want a more powerful editor, this lets you keep Arduino's well tested build process.
 
Status
Not open for further replies.
Back
Top