Teensy 4.0 First Beta Test

Status
Not open for further replies.
@manitou - if you have a white wire on the underside it should update to that version 0.04 bootloader - AFAIK - no white wire then no update.

Should i be able to see the white wire without pulling MCU out of breakout board? I haven't ever pulled MCU out, fearing i'll not get pogo pins aligned again ?? any how, the loader log seems to indicate it's running 0.04.
 
Something very Odd - Teensy.exe is NOT open - and in fact I deleted the file - but Installer says it cannot write the file.

This is the same dir on a non-system folder/drive where prior builds and updates have been done …

The EXE is not marked as Blocked and there were not pop up notices … Ran as Admin and that didn't help. TaskMan doesn't show anything odd or orphaned … machine been up 7 21/24ths days ...

Still running last Fall's Win10.1809.529 - update .529 is new since last update … but I haven't put the newest Spring #1903 build on yet.

Will reboot and see what I see ...

td147b3_Fail.jpg
 
Should i be able to see the white wire without pulling MCU out of breakout board? I haven't ever pulled MCU out, fearing i'll not get pogo pins aligned again ?? any how, the loader log seems to indicate it's running 0.04.

If the unit has the SD card Ribbon - it has White wire. Maybe barely? If no ribbon it is just forward of the SDIO pads and crosses the center of the board.

I know I have both - but can't install yet to test ...
 
Should i be able to see the white wire without pulling MCU out of breakout board? I haven't ever pulled MCU out, fearing i'll not get pogo pins aligned again ?? any how, the loader log seems to indicate it's running 0.04.

I am able to barely see a white wire behind the sd pogo pins when I shine a bright light - but I have pulled out the T4B2M a couple times without any problem.
 
@defragster

I get this when any of the following happens: (1) teensyloader is open or (2) I have Sermon open to that port. Running same version of Windows as you are.
 
Restarted Windows machine - TD 1.47 beta 3 installed no issue - it prompted as 'Ran as Admin' when started with double click.

Running simple sketch with SERIAL SPEW it gave JAVA error text below.

ALL THREE T4B2's did update - including Known BrownOut Pre-Wire no Mod version:
14:40:47.155 (loader): Device came online, code_size = 2031616
14:40:47.155 (loader): Board is: Teensy 4-Beta2 (IMXRT1062), version 0.02
14:40:47.164 (loader): File "Blink_SerFast.ino.hex". 19348 bytes, 1% used
14:40:47.169 (loader): set background IMG_ONLINE
14:40:47.174 (loader): File "Blink_SerFast.ino.hex". 19348 bytes, 1% used
14:40:47.175 (loader): elf appears to be for Teensy 4-Beta2 (IMXRT1062) (2031616 bytes)
14:40:47.185 (loader): elf binary data matches hex file
14:40:47.185 (loader): elf file is for Teensy 4-Beta2 (IMXRT1062)
14:40:47.189 (loader): begin operation
14:40:47.205 (loader): Bootloader upgrade: 0.02 -> 0.04

14:40:52.979 (ports 5): usb_add: usb:0/140000/0/8/6 [no_device] (Teensy) Bootloader
14:40:53.085 (loader): Bootloader update: 59% of estimated 8 seconds, wait=47
14:40:53.095 (loader): Bootloader update finished, 4.7 seconds
14:40:53.105 (loader): Board is: Teensy 4-Beta2 (IMXRT1062), version 0.04
14:40:53.115 (loader): flash, block=0, bs=1024, auto=1
14:40:53.115 (loader): gauge old value = 0
14:40:53.125 (loader): flash, block=1, bs=1024, auto=1
14:40:53.131 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
14:40:53.132 (ports 5): update_usb_device, devinst list change, old had 1, new

I have all three Updates in separate Verbose Log files. >> View attachment 1.47T4B2_BLupgrade_log.zip
I uploaded SKETCH to the FIRST:
T4B2Ribbon :: Bootloader upgrade: 0.03 -> 0.04

Then I did the next two with 'Button Press':
Second T4B2m :: Bootloader upgrade: 0.02 -> 0.04
Third pre-Mod T4B2 :: Bootloader upgrade: 0.02 -> 0.04

Code:
Sketch uses 13168 bytes (0%) of program storage space. Maximum is 2031616 bytes.
Global variables use 17088 bytes (3%) of dynamic memory, leaving 507200 bytes for local variables. Maximum is 524288 bytes.
T:\Ard186t4b2\hardware\teensy/../tools/teensy_post_compile -file=Blink_SerFast.ino -path=T:\TEMP\arduino_build_531626 -tools=T:\Ard186t4b2\hardware\teensy/../tools -board=TEENSY40 -reboot -port=usb:0/140000/0/8/6 -portlabel=hid#vid_16c0&pid_0478 Bootloader -portprotocol=Teensy 
 inputPipeListener thread exit
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at javax.swing.text.GapContent.allocateArray(GapContent.java:94)
	at javax.swing.text.GapVector.resize(GapVector.java:214)
	at javax.swing.text.GapVector.shiftEnd(GapVector.java:229)
	at javax.swing.text.GapContent.shiftEnd(GapContent.java:345)
	at javax.swing.text.GapVector.open(GapVector.java:201)
	at javax.swing.text.GapVector.replace(GapVector.java:142)
	at javax.swing.text.GapContent.insertString(GapContent.java:132)
	at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:723)
	at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707)
	at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
	at javax.swing.JTextArea.append(JTextArea.java:477)
	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:185)
	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:175)
	at processing.app.AbstractTextMonitor$$Lambda$149/32120294.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at javax.swing.text.GapContent.allocateArray(GapContent.java:94)
	at javax.swing.text.GapVector.resize(GapVector.java:214)
	at javax.swing.text.GapVector.shiftEnd(GapVector.java:229)
	at javax.swing.text.GapContent.shiftEnd(GapContent.java:345)
	at javax.swing.text.GapVector.open(GapVector.java:201)
	at javax.swing.text.GapVector.replace(GapVector.java:142)
	at javax.swing.text.GapContent.insertString(GapContent.java:132)
	at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:723)
	at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707)
	at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
	at javax.swing.JTextArea.append(JTextArea.java:477)
	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:185)
	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:175)
	at processing.app.AbstractTextMonitor$$Lambda$149/32120294.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at javax.swing.text.GapContent.allocateArray(GapContent.java:94)
	at javax.swing.text.GapVector.resize(GapVector.java:214)
	at javax.swing.text.GapVector.shiftEnd(GapVector.java:229)
	at javax.swing.text.GapContent.shiftEnd(GapContent.java:345)
	at javax.swing.text.GapVector.open(GapVector.java:201)
	at javax.swing.text.GapVector.replace(GapVector.java:142)
	at javax.swing.text.GapContent.insertString(GapContent.java:132)
	at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:723)
	at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707)
	at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
	at javax.swing.JTextArea.append(JTextArea.java:477)
	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:185)
	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:175)
	at processing.app.AbstractTextMonitor$$Lambda$149/32120294.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at javax.swing.text.GapContent.allocateArray(GapContent.java:94)
	at javax.swing.text.GapVector.resize(GapVector.java:214)
	at javax.swing.text.GapVector.shiftEnd(GapVector.java:229)
	at javax.swing.text.GapContent.shiftEnd(GapContent.java:345)
	at javax.swing.text.GapVector.open(GapVector.java:201)
	at javax.swing.text.GapVector.replace(GapVector.java:142)
	at javax.swing.text.GapContent.insertString(GapContent.java:132)
	at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:723)
	at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707)
	at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
	at javax.swing.JTextArea.append(JTextArea.java:477)
	at processing.app.AbstractTextMonitor.updateTextArea(AbstractTextMonitor.java:185)
	at processing.app.AbstractTextMonitor.lambda$message$0(AbstractTextMonitor.java:175)
	at processing.app.AbstractTextMonitor$$Lambda$149/32120294.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
inputPipeListener thread exit
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
 
Paul - 15s Restore looks good and right! And note ALL three, including brown out unit with no Wire ( which I'm not mentioning ) - took the Bootloader update to #4.

Yep, RTC is set to correct time and is ticking ;)
Code:
// T4 RTC  32khz crystal 
#include <time.h>

void setup() {
}

void loop() {
  time_t tt = rtc_get();
  Serial.printf("%s", ctime(&tt));
  delay(1000);
}

Using this code on each T4 Beta 2 it starts with valid time - so the bootloader upgrade was done and working: "Thu Jun 6 15:16:43 2019"
>On PreMod with Brownout
>On First Mod with white wire
>On latest Ribbon with white wire

"USB View.exe" 15s Restore on T4B2R _ LOOKS GOOD - All THREE units have clean strings and Serial# '0x0409: "Teensyduino RawHID"':
Code:
Device Descriptor:
bcdUSB:             0x0110
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x40 (64)
idVendor:           0x16C0
idProduct:          0x0486
bcdDevice:          0x0279
iManufacturer:        0x01
0x0409: "Teensyduino"
iProduct:             0x02
0x0409: "Teensyduino RawHID"
iSerialNumber:        0x03
0x0409: "5889290"
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     High
Device Address:       0x26
Open Pipes:              4

Endpoint Descriptor:
bEndpointAddress:     0x83  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0040 (64)
bInterval:            0x01

Endpoint Descriptor:
bEndpointAddress:     0x04  OUT
Transfer Type:   Interrupt
wMaxPacketSize:     0x0040 (64)
bInterval:            0x01

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0040 (64)
bInterval:            0x01

Endpoint Descriptor:
bEndpointAddress:     0x02  OUT
Transfer Type:   Interrupt
wMaxPacketSize:     0x0020 (32)
bInterval:            0x02

Configuration Descriptor:
wTotalLength:       0x0049
bNumInterfaces:       0x02
bConfigurationValue:  0x01
iConfiguration:       0x00
bmAttributes:         0xC0 (Bus Powered Self Powered )
MaxPower:             0x32 (100 Ma)

Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0x03 (HID)
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:           0x00

HID Descriptor:
bcdHID:             0x0111
bCountryCode:         0x00
bNumDescriptors:      0x01
bDescriptorType:      0x22
wDescriptorLength:  0x001C

Endpoint Descriptor:
bEndpointAddress:     0x83  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0040 (64)
bInterval:            0x01

Endpoint Descriptor:
bEndpointAddress:     0x04  OUT
Transfer Type:   Interrupt
wMaxPacketSize:     0x0040 (64)
bInterval:            0x01

Interface Descriptor:
bInterfaceNumber:     0x01
bAlternateSetting:    0x00
bNumEndpoints:        0x02
bInterfaceClass:      0x03 (HID)
bInterfaceSubClass:   0x00
bInterfaceProtocol:   0x00
iInterface:           0x00

HID Descriptor:
bcdHID:             0x0111
bCountryCode:         0x00
bNumDescriptors:      0x01
bDescriptorType:      0x22
wDescriptorLength:  0x0021

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0040 (64)
bInterval:            0x01

Endpoint Descriptor:
bEndpointAddress:     0x02  OUT
Transfer Type:   Interrupt
wMaxPacketSize:     0x0020 (32)
bInterval:            0x02
 
PaulStoffregen said:
Speaking of that list, there are several lines for the 15 sec restore ending up with a corrupted blink program which Windows won't recognize as RawHID (or Arduino can't upload without pressing the button). Are all those issues solved now?
Didn't notice it before so just tested again. After 15sec restore Windows showed it as Raw Hid (Teensy 4 Beta-2). I powered it off and on and it still shows the same until I upload a sketch. I did this a couple of times and each time after the restore it came back with Raw Hid.
 
@defragster

I get this when any of the following happens: (1) teensyloader is open or (2) I have Sermon open to that port. Running same version of Windows as you are.

@defragster - And of course if all else fails... Reboot!

Very Odd! IDE was closed - and TaskMan indicated free of any Teensy programs - and in fact as noted I deleted the file it said it could not write - and it failed after that …

But was Eeezy Peezy after reboot. No other adjustments or fights with Antivirus or anything Windows - as noted the EXE with just a 'double Click' already knew to run 'As Admin' and I got that 'Confirm' screen before Installer would run.

Of all the TeensyInstaller runs - that is the first that showed up - I was wondering if a Windows update ramped up security - but with reboot running fine that doesn't seem to be the case.
 
Didn't notice it before so just tested again. After 15sec restore Windows showed it as Raw Hid (Teensy 4 Beta-2). I powered it off and on and it still shows the same until I upload a sketch. I did this a couple of times and each time after the restore it came back with Raw Hid.

This shows the bootloader edit got it fixed on Windows - For @mjs513 and @defragster 3 units. I'll look to go mark that RESOLVED if still open.

I see it there maybe 6 times?
I'm not sure what this one applies to so not marking is as Solved:
Code:
Does bootloader & 15-sec restore process work with all possible default FlexRAM settings in HW_OCOTP_MISC_CONF0? Can all 1s setting brick Teensy4?
 
Robin & I recently decided we're *not* doing a Kickstarter campaign for Teensy 4.0.

...

Speaking of that list, there are several lines for the 15 sec restore ending up with a corrupted blink program which Windows won't recognize as RawHID (or Arduino can't upload without pressing the button). Are all those issues solved now?

Kickstarter would have been fun and fast … for us users :) Some immeasurable overhead for PJRC …

I marked four of the 15s Restore items fixed with Bootloader Version 4 as : Solved Bload v4

I marked the last one as 'Solved ?' since I'm note sure if there were other issues not linked that I didn't test.
Does bootloader & 15-sec restore process work with all possible default FlexRAM settings in HW_OCOTP_MISC_CONF0? Can all 1s setting brick Teensy4?
 
If you're sure an issue is completely resolved, please delete those lines from msg #6. Don't just mark resolved. Delete it, so the list gets shorter. :)

I *still* have a few more things to do on the test fixture, but they won't take long. My hope is to start pouring all my dev time next week into making that list much shorter.
 
If you're sure an issue is completely resolved, please delete those lines from msg #6. Don't just mark resolved. Delete it, so the list gets shorter. :)

I *still* have a few more things to do on the test fixture, but they won't take long. My hope is to start pouring all my dev time next week into making that list much shorter.

DANG - just edited in TWO more for RTC … Argggh … that list is way too long to edit - so doing that now is a GREAT idea ...
 
The Message #6 items I recognized as RTC and 15s Restore Solved have been removed.

In msg#4 RTC marked as Solved BLoad v4
 
Just deleted 6 issues in message #6 that I am sure is 100% fixed:
Solved!IssueReference Comment
Fixedpadconfig register defines #906Verified in core
SolvedCAN startup/init issue, #405, #402tonton81-mjs513CAN2.0 tested on both B1 and B2
Solvedpin 0,1 not working for quadrature encoder, #1056,mjs513Tested B1/b2
FixedRadioHeadmjs513needs SPI.end, #1009, #1032, #1040, #1174, #1175, -- PR #25 incorporated into Teensy Lib
SolvedTalkie, not working, expects DAC, #561 #548mjs513Added support for PWM option, in latest Teensyduino
EEPROM and NXPMotionSense, #3064,
likely fixed

EDIT: Pretty EEPROM and NXPMotionSense can be deleted as well - @manitou - do you agree. -- SEE NEXT POST
 
Last edited:
SPI - There are several items in that first list, that I think we can remove/replace...

Things like:
minimal code works SPI minimal code in beta3
SPISettings not used, clock fixed at 12.5 MHz, #428
SPI1 & SPI2 support, #2404, #2409, #2482, #2488, #2493, #2518,

Not sure:
SPI example crashes if infinite loop after result, #125 can't reproduce

SPI signal drive strength, #2500,
(Could not tell if they are saying T3.x works fine and this does not, or they could muck something on T3.x and think they should be able to on T4...)

Serial
serialEvent() missing, #2561,
 
SPI - There are several items in that first list, that I think we can remove/replace...

Things like:



Serial
serialEvent() missing, #2561,

@KurtE - not sure what list you had this in?

The main() code is still debug - no yield() and no serialEvent() processing or eventResponder code tested.
from ...\hardware\teensy\avr\cores\teensy4\startup.c:
Code:
	printf("before setup\n");
	setup();
	printf("after setup\n");
	while (1) {
		//printf("loop\n");
		loop();
	}
}

Delay and some other places does call yield() ...
 
Sorry - really didn't mean to try and get around anything - getting tired and that table is so long its tough to edit :(. Going to add it to the list in post 3191.

Sorry you misunderstood my poor attempt at humor. I had actually tried to reply to your post with just "sure", and the forum gui (vBulletin) would not accept such a short reply. go figure.
 
Starting with @manitou's RTC compile time test - was looking to see microseconds micros() running in step with millis() so I tweaked as below, with the quick test of "delayMicroseconds(100); // Confirm CycCnt is running" in setup.

First step in setup() shows this is very pretty watching the first 10 ms change and showing micros() they all look like this:
362000<< micros() and millis() >>362
363000<< micros() and millis() >>363
364000<< micros() and millis() >>364

Then the repeated loop() watching seconds pass shows the RTC 32khz crystal to be independent of the processor clocking.
One T4 misses [0 or 1] us per sec the 2nd [4 or 5] us per sec and this third at [10 or 11] us per sec.

Got back to the last one - now losing [9 or 10] us per sec.
@micros>>5514533 [ms>>5514] Time is Thu Jun 6 23:11:06 2019
@micros>>6514524 [ms>>6514] Time is Thu Jun 6 23:11:07 2019
@micros>>7514515 [ms>>7514] Time is Thu Jun 6 23:11:08 2019
@micros>>8514505 [ms>>8514] Time is Thu Jun 6 23:11:09 2019
@micros>>9514496 [ms>>9514] Time is Thu Jun 6 23:11:10 2019
@micros>>10514486 [ms>>10514] Time is Thu Jun 6 23:11:11 2019

Anyhow that is a good sign the micros() code based on ARM_CycCnt is running right - at least keeping steady with RTC - and RTC starting on all three B2 units, and updated on UPLOAD when gone unpowered.

@Paul: again … Good Work! - the concept of using Bootloader and in the execution :cool:
All three running SAME Current time - even if upload at different time because the bootloader gets CURRENT PC time through TeensyLoader - not 'time of compile'.
One unit has { VBat cell or UART VamPower }, another is on external power, third nothing and loses time - all seem good/as expected. Plug/Unplug or POWER Off/On.


Code:
// T4 RTC  32khz crystal
#include <time.h>
void setup() {
  pinMode( LED_BUILTIN, OUTPUT );
  digitalWriteFast( LED_BUILTIN, HIGH );
  delayMicroseconds(100); // Confirm CycCnt is running
  while ( !Serial );
  digitalWriteFast( LED_BUILTIN, LOW );
  uint32_t iWait = millis();
  uint32_t jj;
  for ( int ii = 0; ii < 10; ii++ ) {
    while ( iWait == millis() );
    Serial.printf("%u<< micros() and millis() >>%u\n", micros(),  iWait = millis() );
  }
}
void loop() {
  time_t tt, jj;
  tt = rtc_get();
  while ( tt == rtc_get() ) jj = micros();
  Serial.printf("@micros>>%u [ms>>%u] Time is %s", jj, millis(), ctime(&tt));
  digitalWriteFast( LED_BUILTIN, !digitalReadFast( LED_BUILTIN) );
}
 
Last edited:
@defragster

I just reran Coremark to see if this was still applicable:
fault after coremark using 50000, msg #117.Prevent Fault Edit Post #651

At 24000 iterations I am not seeing any faults:
Code:
coremark running

2305289
2K performance run parameters for coremark.
2305290 us 10456385 
CoreMark Size    : 666
Total ticks      : 10456367
Total time (secs): 10.456367
Iterations/Sec   : 2295.252261
Iterations       : 24000
Compiler version : 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496]
Compiler flags   : 
Memory location  : STACK
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x4983
Correct operation validated. See readme.txt for run and reporting rules.
CoreMark 1.0 : 2295.252261 / 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496]  / STACK
.... done
done
Think it can be closed/deleted.
 
ANALOG READ on PINS 26/27

Looking at this issue:
analogRead not yet supporting A12 & A13, #2427,
Looks like pins_arduino.h has to be changed and analog.c. pins_arduino.h I understand what has to be changed so that's not a problem. Don't understand this table in analog.c though - "pin to channel". It references pg482 in the RM but don't think that's correct page reference, but know to be wrong:
Code:
const uint8_t pin_to_channel[] = { // pg 482
	7,	// 0/A0  AD_B1_02
	8,	// 1/A1  AD_B1_03
	12,	// 2/A2  AD_B1_07
	11,	// 3/A3  AD_B1_06
	6,	// 4/A4  AD_B1_01
	5,	// 5/A5  AD_B1_00
	15,	// 6/A6  AD_B1_10
	0,	// 7/A7  AD_B1_11
	13,	// 8/A8  AD_B1_08
	14,	// 9/A9  AD_B1_09
	128,	// 10
	128,	// 11
	128,	// 12
	128,	// 13
	7,	// 14/A0  AD_B1_02
	8,	// 15/A1  AD_B1_03
	12,	// 16/A2  AD_B1_07
	11,	// 17/A3  AD_B1_06
	6,	// 18/A4  AD_B1_01
	5,	// 19/A5  AD_B1_00
	15,	// 20/A6  AD_B1_10
	0,	// 21/A7  AD_B1_11
	13,	// 22/A8  AD_B1_08
	14,	// 23/A9  AD_B1_09
	1,	// 24/A10 AD_B0_12
	2	// 25/A11 AD_B0_13
		// 26/A12 AD_B1_14 - only on ADC2
		// 27/A13 AD_B1_15 - only on ADC2
};
Any help would be appreciated.

Updated pins_arduino.h and noticed that pins 24/25 weren't working either - was wrapped in an ifdef for 1052 only. Fixed that and got pins 24/25 working.

EDIT: @Paul
Ok found the old manual and found page 482. As the notes said pins 26/27 are on ADC2 (my bad) and we are only initializing ADC1. So the QUESTION becomes do we want to show this as A12/A13. If we do we are going to have to enable ADC2 as well. Things are finally registering.
 
Last edited:
@KurtE - not sure what list you had this in?

The main() code is still debug - no yield() and no serialEvent() processing or eventResponder code tested.
from ...\hardware\teensy\avr\cores\teensy4\startup.c:
Code:
	printf("before setup\n");
	setup();
	printf("after setup\n");
	while (1) {
		//printf("loop\n");
		loop();
	}
}

Delay and some other places does call yield() ...

Hi @defragster (and others) - As I mentioned I thought some of these items could be removed or replaced (reworded).
That is, there is code in place that is about 10 or do from the bottom of list #6 is (I think comment added)
Code:
serialEvent() missing, #2561, 		Not present :: Normal T_3.x main() {setup() while(1){loop();delay();}}

I believe that the issue is not that SerialEvent is missing? As SerialEvents are called from yield.... The issue(s) are:
a) the main code in startup.c needs to be cleaned up and made ready for release (probably minimum is to comment out printf calls.
b) The while(1) loop is not calling yield() Edit: Note calling delay(0) does not do anything, delay checks for 0 and returns

c) eventResponder code - Edit call to run from yield is in yield. Also more long term I know that Paul want's to implement some of the Serial Event code to use the event Responder code.... Currently the version is similar to T3 code and loops through the different Serial ports, checking for SerialX.avaliable() and then call the SerialEvent... There are some shortcuts in this current code. There is an array of (N) SerialEventHandlers functions, which if the pointer is NOT null, it will call off to that Serials. objects check for pending Serial... This is called in SerialX.begin(). If the default SerialEventX (weak pointer) is called the default code will remove itself from the list. If all such functions, removed the loop is not called...

d) One part of the SerialEvent missing call, that is NOT in, is for the USB serial, as we did not have a working USB Serial input code. Probably can/should add soon.
 
Status
Not open for further replies.
Back
Top