library builds/ runs in platform IO builds and locks teensy with 9 red led flashes

benyboy

Member
I am trying to compile a project based on this library that I adapted for arduino.

https://github.com/mgergos/Opus4Teensy

my end goal is to make a library for arduino teensy.

the library compiles fine in platform.io using these build flags

build_flags =
-D OPUS_BUILD
-D FIXED_POINT
-D OVERRIDE_OPUS_ALLOC
-D OVERRIDE_OPUS_FREE
-D VAR_ARRAYS
-D HAVE_CONFIG_H
-D OVERRIDE_OPUS_ALLOC_SCRATCH
-D DISABLE_FLOAT_API
-D OPUS_ARM_INLINE_EDSP
-D EMBEDDED_ARM
-D OPUS_ARM_ASM
-D'opus_alloc(x)=NULL'
-D'opus_free(x)=NULL'

I realise that Arduino doesn't really support build flags in libraries so I just made a header file with the defines and included that in every file in the library.

The build completes but the hardware will not run. It just locks up with a USB warning light flashing 9 times. ( a teensy error message warning USB connection is lost? )

I checked the compile flags in platform IO and arduino in boards.txt and they appear to be the same.

ultimately arduino and platform.io both compile the code using GCC so I am not sure where to go next.

any ideas / things I can try would be much appreciated. the build defines are just telling the library to compile code in a certain way which is working as expected in platform.io

thanks in advance :)
 
Last edited:
my header file defines are like this;

Code:
#ifndef GOLBAL_LIB_DEFINES_H
#define GOLBAL_LIB_DEFINES_H

#ifdef __cplusplus
extern "C"
{
#endif


#define OPUS_BUILD
#define FIXED_POINT
#define OVERRIDE_OPUS_ALLOC 
#define OVERRIDE_OPUS_FREE 
#define VAR_ARRAYS 
#define HAVE_CONFIG_H 
#define OVERRIDE_OPUS_ALLOC_SCRATCH 
#define DISABLE_FLOAT_API 
#define OPUS_ARM_INLINE_EDSP 
#define EMBEDDED_ARM 
#define OPUS_ARM_ASM 
#define opus_alloc(x) NULL
#define opus_free(x) NULL



#ifdef __cplusplus
}
#endif

#endif
 
Can this T_4.x? (which 4.0 or 4.1?) be programmed using the same computer and cable with a simple Blink and other sketches? With supported IDE?

This page: pjrc.com/store/ic_mkl02_t4.html
indicates:
Code:
9 Blinks = ARM JTAG DAP Init Error
The ARM JTAG DAP was detected (4 blinks) but could not be initialized. This error is rather unlikely!
Where:
Code:
4 Blinks = ARM JTAG & SWD Not Responding (Needs Crystal)
The NXP JTAG communication is working, but communication with ARM JTAG or SWD fails. Usually this error means the 24 MHz crystal is not oscillating. NXP's JTAG does not require the oscillator, but the ARM JTAG does. This error also be caused by a bad connection between PTB5 to AD_B0_08, which is the signal that selects which JTAG controller is accessible.
 
9 blinks on red LED , teensy 4.1 , same code build runs and uploads on platform IO

Can this T_4.x? (which 4.0 or 4.1?) be programmed using the same computer and cable with a simple Blink and other sketches? With supported IDE?

sorry , its a T 4.1 with teensy audio board 4.0 with only the required pins for the STG5000 connected ( not the uSD card )

I am using the same usb data cable which works with other sketches.

I can compile other code such as blinky and other audio examples on the board with the teensy audio shield without the 9 blinks.

I am getting 9 blinks on the red LED next to the usb port after Arduino successfully compiles
I loose the usb port from tools - port in arduino IDE until I re-plug the cable.

I can successfully compile/upload blinky again after re-plugging in the cable in Arduino IDE

sort of run out of ideas!
 
Sounds like something going wrong in the upload of 'troubled' sketch.

In the Teensy loader program do Help / Verbose Info and clear that window.

Then try the upload again and it will list the process messages as it goes that might lead to some hint with what does or does not show up.

Are any other pins connected beyond those for the Audio Shield?
 
Sounds like something going wrong in the upload of 'troubled' sketch.

In the Teensy loader program do Help / Verbose Info and clear that window.

Then try the upload again and it will list the process messages as it goes that might lead to some hint with what does or does not show up.

Are any other pins connected beyond those for the Audio Shield?



There was a RF shield connected by I just removed it. no init code was run for it yet anyway.

here is the loader log.


18:49:54.689 (ports 5): Begin, version=1.57, high-res time
18:49:54.689 (ports 5): LoadLibrary cfgmgr32 ok
18:49:54.689 (ports 5): LoadLibrary ntdll ok
18:49:54.695 (ports 5): callback 0024
18:49:54.695 (ports 5): callback 0081
18:49:54.698 (ports 5): callback 0083
18:49:54.698 (ports 5): hWnd = 4000964
18:49:54.700 (ports 5): found_usb_device, id=\\?\usb#vid_16c0&pid_048b#12010150#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
18:49:54.700 (ports 5): found_usb_device, loc=usb:0/140000/0/1 Port_#0001.Hub_#0002
18:49:54.700 (ports 5): found_usb_device, hwid=USB\VID_16C0&PID_048B&REV_0280
18:49:54.700 (ports 5): found_usb_device, devinst=00000003
18:49:54.700 (ports 5): add: loc=usb:0/140000/0/1, class=USB, vid=16C0, pid=048B, ver=0280, serial=12010150, dev=\\?\usb#vid_16c0&pid_048b#12010150#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
18:49:54.700 (ports 5): comport_from_devinst_list attempt
18:49:54.700 (ports 5): found Ports in classguid_list at index=1
18:49:54.700 (ports 5): port COM12 found from devnode
18:49:54.700 (ports 5): found_usb_device complete
18:49:54.702 (ports 5): usb_add: usb:0/140000/0/1 COM12 (Teensy 4.1) Dual Serial
18:52:12.533 (post_compile 1): Begin, version=1.57, high-res time
18:52:13.657 (loader): Teensy Loader 1.57, begin program
18:52:13.741 (loader): Listening for remote control on port 3149
18:52:13.746 (loader): initialized, showing main window
18:52:13.767 (loader): remote connection 1400 opened
18:52:13.769 (post_compile 1): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)
18:52:13.769 (loader): remote cmd from 1400: "comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)"
18:52:13.771 (loader): remote cmd from 1400: "status"
18:52:13.775 (loader): HID/win32: vid:044E pid:1222 ver:0108
18:52:13.775 (loader): HID/win32: vid:044E pid:1222 ver:0108
18:52:13.776 (loader): HID/win32: vid:0001 pid:0001 ver:0001
18:52:13.778 (loader): HID/win32: vid:046D pid:C21F ver:0000
18:52:13.780 (loader): HID/win32: vid:044E pid:1212 ver:B719
18:52:13.781 (loader): HID/win32: vid:00FF pid:BACC ver:0001
18:52:13.784 (loader): HID/win32: vid:00FF pid:BACC ver:0001
18:52:13.788 (loader): HID/win32: vid:044E pid:1222 ver:0108
18:52:13.791 (loader): remote cmd from 1400: "dir:C:\Users\ben\AppData\Local\Temp\arduino_build_304004\"
18:52:13.791 (post_compile 1): Status: 0, 0, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_157976\, Blink.pde.hex
18:52:13.791 (post_compile 1): Sending command: dir:C:\Users\ben\AppData\Local\Temp\arduino_build_304004\
18:52:13.792 (post_compile 1): Sending command: file:OPUS_TX.ino.hex
18:52:13.792 (loader): remote cmd from 1400: "file:OPUS_TX.ino.hex"
18:52:13.814 (loader): File "C:\Users\ben\AppData\Local\Temp\arduino_build_304004\OPUS_TX.ino.hex", 149504 bytes
18:52:13.814 (loader): File "OPUS_TX.ino.hex". 149504 bytes
18:52:13.818 (loader): remote cmd from 1400: "status"
18:52:13.820 (post_compile 1): Status: 1, 0, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:13.820 (post_compile 1): Sending command: auto:eek:n
18:52:13.822 (loader): remote cmd from 1400: "auto:eek:n"
18:52:13.822 (post_compile 1): Disconnect
18:52:13.836 (loader): remote connection 1400 closed
18:52:20.559 (post_compile 2): Begin, version=1.57, high-res time
18:52:20.561 (loader): remote connection 1492 opened
18:52:20.561 (loader): remote cmd from 1492: "comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)"
18:52:20.561 (loader): remote cmd from 1492: "status"
18:52:20.561 (post_compile 2): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_post_compile)
18:52:20.563 (loader): remote cmd from 1492: "dir:C:\Users\ben\AppData\Local\Temp\arduino_build_304004\"
18:52:20.563 (loader): remote cmd from 1492: "file:OPUS_TX.ino.hex"
18:52:20.563 (post_compile 2): Status: 1, 1, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:20.563 (post_compile 2): Sending command: dir:C:\Users\ben\AppData\Local\Temp\arduino_build_304004\
18:52:20.563 (post_compile 2): Sending command: file:OPUS_TX.ino.hex
18:52:20.587 (loader): File "C:\Users\ben\AppData\Local\Temp\arduino_build_304004\OPUS_TX.ino.hex", 149504 bytes
18:52:20.587 (loader): File "OPUS_TX.ino.hex". 149504 bytes
18:52:20.593 (loader): remote cmd from 1492: "status"
18:52:20.595 (post_compile 2): Status: 1, 1, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:20.595 (post_compile 2): Disconnect
18:52:20.611 (loader): remote connection 1492 closed
18:52:20.611 (loader): remote connection 1504 opened
18:52:20.611 (post_compile 3): Running teensy_reboot: "C:\Program Files (x86)\Arduino\hardware\teensy\..\tools\teensy_reboot.exe" teensy_reboot.exe "-board=TEENSY41" "-port=usb:0/140000/0/1" "-portlabel=COM12 Dual Serial" "-portprotocol=Teensy"
18:52:21.670 (reboot 4): Begin, version=1.57, high-res time
18:52:21.670 (reboot 4): location = usb:0/140000/0/1
18:52:21.670 (reboot 4): portlabel = COM12 Dual Serial
18:52:21.670 (reboot 4): portprotocol = Teensy
18:52:21.670 (reboot 4): Only location usb:0/140000/0/1 will be tried
18:52:21.670 (reboot 4): LoadLibrary cfgmgr32 ok
18:52:21.670 (reboot 4): LoadLibrary ntdll ok
18:52:21.671 (reboot 4): found_usb_device, id=\\?\usb#vid_16c0&pid_048b#12010150#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
18:52:21.671 (reboot 4): found_usb_device, loc=usb:0/140000/0/1 Port_#0001.Hub_#0002
18:52:21.671 (reboot 4): found_usb_device, hwid=USB\VID_16C0&PID_048B&REV_0280
18:52:21.671 (reboot 4): found_usb_device, devinst=00000003
18:52:21.671 (reboot 4): add: loc=usb:0/140000/0/1, class=USB, vid=16C0, pid=048B, ver=0280, serial=12010150, dev=\\?\usb#vid_16c0&pid_048b#12010150#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
18:52:21.671 (reboot 4): comport_from_devinst_list attempt
18:52:21.671 (reboot 4): found Ports in classguid_list at index=1
18:52:21.671 (reboot 4): port COM12 found from devnode
18:52:21.671 (reboot 4): found_usb_device complete
18:52:21.674 (reboot 4): usb scan found 1 devices
18:52:21.676 (loader): remote connection 1516 opened
18:52:21.676 (loader): remote cmd from 1516: "show:arduino_attempt_reboot"
18:52:21.676 (loader): got request to show arduino rebooting message
18:52:21.676 (reboot 4): found Teensy Loader, version 1.57
18:52:21.676 (reboot 4): Sending command: show:arduino_attempt_reboot
18:52:21.678 (reboot 4): Sending command: comment: Teensyduino 1.57 - WINDOWS (teensy_reboot)
18:52:21.678 (loader): remote cmd from 1516: "comment: Teensyduino 1.57 - WINDOWS (teensy_reboot)"
18:52:21.678 (loader): remote cmd from 1516: "status"
18:52:21.681 (reboot 4): Status: 1, 1, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:21.681 (reboot 4): do_reset (serial) COM12
18:52:21.683 (loader): remote cmd from 1516: "status"
18:52:21.686 (reboot 4): Status: 1, 1, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:21.686 (reboot 4): status read, retry 0
18:52:21.755 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
18:52:21.758 (ports 5): callback 000E
18:52:21.758 (ports 5): callback 000D
18:52:21.758 (ports 5): callback 000D
18:52:21.761 (loader): remote connection 1492 opened
18:52:21.762 (ports 5): remove: loc=usb:0/140000/0/1
18:52:21.762 (ports 5): usb_remove: usb:0/140000/0/1
18:52:21.762 (ports 5): nothing new, skipping HID & Ports enum
18:52:21.766 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
18:52:21.766 (ports 5): nothing new, skipping HID & Ports enum
18:52:21.768 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
18:52:21.769 (ports 5): nothing new, skipping HID & Ports enum
18:52:21.793 (loader): remote cmd from 1516: "status"
18:52:21.795 (reboot 4): Status: 1, 1, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:21.795 (reboot 4): status read, retry 1
18:52:21.902 (loader): remote cmd from 1516: "status"
18:52:21.905 (reboot 4): Status: 1, 1, 0, 0, 0, 0, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:21.905 (reboot 4): status read, retry 2
18:52:21.975 (ports 5): WM_DEVICECHANGE DBT_DEVICEARRIVAL
18:52:21.976 (ports 5): found_usb_device, id=\\?\usb#vid_16c0&pid_0478#00125377#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
18:52:21.976 (ports 5): found_usb_device, loc=usb:0/140000/0/1 Port_#0001.Hub_#0002
18:52:21.976 (ports 5): found_usb_device, devinst=0000001b
18:52:21.976 (ports 5): found_usb_device, hwid=USB\VID_16C0&PID_0478&REV_0107
18:52:21.976 (ports 5): add: loc=usb:0/140000/0/1, class=HID, vid=16C0, pid=0478, ver=0107, serial=00125377, dev=\\?\usb#vid_16c0&pid_0478#00125377#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
18:52:21.977 (ports 5): hiddev_from_devinst_list: iface=0
18:52:21.977 (ports 5): found_usb_device complete
18:52:21.978 (ports 5): hid, found devinst=0000001C
18:52:21.978 (ports 5): hid, path=\\?\hid#vid_16c0&pid_0478#6&133f5364&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
18:52:21.978 (ports 5): hid, opened handle
18:52:21.979 (ports 5): devinst=0000001C, location=usb:0/140000/0/1
18:52:21.979 (ports 5): vid=16C0, pid=0478, ver=0107, usepage=FF9C, use=0025
18:52:21.979 (ports 5): devpath=\\?\hid#vid_16c0&pid_0478#6&133f5364&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
18:52:21.979 (ports 5): usb_add: usb:0/140000/0/1 hid#vid_16c0&pid_0478 (Teensy 4.1) Bootloader
18:52:22.001 (loader): secure mode can not be locked: this is Standard Teensy
18:52:22.001 (loader): encryption is possible on this Teensy, but not yet configured
18:52:22.001 (loader): but without secure mode locked, encryption will NOT be secure!
18:52:22.001 (loader): Device came online, code_size = 8126464
18:52:22.001 (loader): Board is: Teensy 4.1 (IMXRT1062), version 1.07
18:52:22.024 (loader): File "C:\Users\ben\AppData\Local\Temp\arduino_build_304004\OPUS_TX.ino.hex", 149504 bytes
18:52:22.024 (loader): File "OPUS_TX.ino.hex". 149504 bytes, 2% used
18:52:22.053 (loader): set background IMG_ONLINE
18:52:22.077 (loader): File "C:\Users\ben\AppData\Local\Temp\arduino_build_304004\OPUS_TX.ino.hex", 149504 bytes
18:52:22.077 (loader): File "OPUS_TX.ino.hex". 149504 bytes, 2% used
18:52:22.105 (loader): elf appears to be for Teensy 4.1 (IMXRT1062) (8126464 bytes)
18:52:22.105 (loader): elf binary data matches hex file
18:52:22.105 (loader): elf file is for Teensy 4.1 (IMXRT1062)
18:52:22.105 (loader): using hex file
18:52:22.130 (loader): begin operation
18:52:22.164 (loader): remote cmd from 1516: "status"
18:52:22.164 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:22.166 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
18:52:22.166 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
18:52:22.167 (ports 5): nothing new, skipping HID & Ports enum
18:52:22.181 (loader): flash, block=0, bs=1024, auto=1
18:52:22.182 (loader): flash, block=1, bs=1024, auto=1
18:52:22.182 (loader): flash, block=2, bs=1024, auto=1
18:52:22.489 (loader): remote cmd from 1516: "status"
18:52:22.490 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:22.497 (loader): flash, block=3, bs=1024, auto=1
18:52:22.498 (loader): flash, block=4, bs=1024, auto=1
18:52:22.508 (loader): flash, block=5, bs=1024, auto=1
18:52:22.511 (loader): flash, block=6, bs=1024, auto=1
18:52:22.513 (loader): flash, block=7, bs=1024, auto=1
18:52:22.515 (loader): flash, block=8, bs=1024, auto=1
18:52:22.516 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
18:52:22.517 (loader): flash, block=9, bs=1024, auto=1
18:52:22.517 (ports 5): nothing new, skipping HID & Ports enum
18:52:22.521 (loader): flash, block=10, bs=1024, auto=1
18:52:22.523 (loader): flash, block=11, bs=1024, auto=1
18:52:22.525 (loader): flash, block=12, bs=1024, auto=1
18:52:22.527 (loader): flash, block=13, bs=1024, auto=1
18:52:22.528 (loader): flash, block=14, bs=1024, auto=1
18:52:22.532 (loader): flash, block=15, bs=1024, auto=1
18:52:22.535 (loader): flash, block=16, bs=1024, auto=1
18:52:22.539 (loader): flash, block=17, bs=1024, auto=1
18:52:22.542 (loader): flash, block=18, bs=1024, auto=1
18:52:22.548 (loader): flash, block=19, bs=1024, auto=1
18:52:22.551 (loader): remote cmd from 1516: "status"
18:52:22.552 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:22.553 (loader): flash, block=20, bs=1024, auto=1
18:52:22.555 (loader): flash, block=21, bs=1024, auto=1
18:52:22.558 (loader): flash, block=22, bs=1024, auto=1
18:52:22.561 (loader): flash, block=23, bs=1024, auto=1
18:52:22.565 (loader): flash, block=24, bs=1024, auto=1
18:52:22.570 (loader): flash, block=25, bs=1024, auto=1
18:52:22.573 (loader): flash, block=26, bs=1024, auto=1
18:52:22.576 (loader): flash, block=27, bs=1024, auto=1
18:52:22.578 (loader): flash, block=28, bs=1024, auto=1
18:52:22.581 (loader): flash, block=29, bs=1024, auto=1
18:52:22.585 (loader): flash, block=30, bs=1024, auto=1
18:52:22.588 (loader): flash, block=31, bs=1024, auto=1
18:52:22.591 (loader): flash, block=32, bs=1024, auto=1
18:52:22.595 (loader): flash, block=33, bs=1024, auto=1
18:52:22.598 (loader): flash, block=34, bs=1024, auto=1
18:52:22.601 (loader): flash, block=35, bs=1024, auto=1
18:52:22.604 (loader): flash, block=36, bs=1024, auto=1
18:52:22.607 (loader): flash, block=37, bs=1024, auto=1
18:52:22.610 (loader): remote cmd from 1516: "status"
18:52:22.611 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:22.612 (loader): flash, block=38, bs=1024, auto=1
18:52:22.615 (loader): flash, block=39, bs=1024, auto=1
18:52:22.619 (loader): flash, block=40, bs=1024, auto=1
18:52:22.622 (loader): flash, block=41, bs=1024, auto=1
18:52:22.624 (loader): flash, block=42, bs=1024, auto=1
18:52:22.627 (loader): flash, block=43, bs=1024, auto=1
18:52:22.629 (loader): flash, block=44, bs=1024, auto=1
18:52:22.632 (loader): flash, block=45, bs=1024, auto=1
18:52:22.635 (loader): flash, block=46, bs=1024, auto=1
18:52:22.638 (loader): flash, block=47, bs=1024, auto=1
18:52:22.642 (loader): flash, block=48, bs=1024, auto=1
18:52:22.645 (loader): flash, block=49, bs=1024, auto=1
18:52:22.649 (loader): flash, block=50, bs=1024, auto=1
18:52:22.652 (loader): flash, block=51, bs=1024, auto=1
18:52:22.657 (loader): flash, block=52, bs=1024, auto=1
18:52:22.661 (loader): flash, block=53, bs=1024, auto=1
18:52:22.666 (loader): flash, block=54, bs=1024, auto=1
18:52:22.669 (loader): flash, block=55, bs=1024, auto=1
18:52:22.672 (loader): remote cmd from 1516: "status"
18:52:22.673 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:22.674 (loader): flash, block=56, bs=1024, auto=1
18:52:22.676 (loader): flash, block=57, bs=1024, auto=1
18:52:22.680 (loader): flash, block=58, bs=1024, auto=1
18:52:22.683 (loader): flash, block=59, bs=1024, auto=1
18:52:22.686 (loader): flash, block=60, bs=1024, auto=1
18:52:22.690 (loader): flash, block=61, bs=1024, auto=1
18:52:22.693 (loader): flash, block=62, bs=1024, auto=1
18:52:22.695 (loader): flash, block=63, bs=1024, auto=1
18:52:22.698 (loader): flash, block=64, bs=1024, auto=1
18:52:22.702 (loader): flash, block=65, bs=1024, auto=1
18:52:22.705 (loader): flash, block=66, bs=1024, auto=1
18:52:22.709 (loader): flash, block=67, bs=1024, auto=1
18:52:22.712 (loader): flash, block=68, bs=1024, auto=1
18:52:22.716 (loader): flash, block=69, bs=1024, auto=1
18:52:22.719 (loader): flash, block=70, bs=1024, auto=1
18:52:22.724 (loader): flash, block=71, bs=1024, auto=1
18:52:22.726 (loader): flash, block=72, bs=1024, auto=1
18:52:22.730 (loader): flash, block=73, bs=1024, auto=1
18:52:22.733 (loader): flash, block=74, bs=1024, auto=1
18:52:22.736 (loader): flash, block=75, bs=1024, auto=1
18:52:22.738 (loader): remote cmd from 1516: "status"
18:52:22.739 (reboot 4): Status: 1, 1, 1, 1, 0, 1, C:\Users\ben\AppData\Local\Temp\arduino_build_304004\, OPUS_TX.ino.hex
18:52:22.740 (loader): flash, block=76, bs=1024, auto=1
18:52:22.742 (loader): flash, block=77, bs=1024, auto=1
18:52:22.746 (loader): flash, block=78, bs=1024, auto=1
18:52:22.748 (loader): flash, block=79, bs=1024, auto=1
18:52:22.753 (loader): flash, block=80, bs=1024, auto=1
18:52:22.756 (loader): flash, block=81, bs=1024, auto=1
18:52:22.759 (loader): flash, block=82, bs=1024, auto=1
18:52:22.762 (loader): flash, block=83, bs=1024, auto=1
18:52:22.764 (loader): flash, block=84, bs=1024, auto=1
18:52:22.767 (loader): flash, block=85, bs=1024, auto=1
18:52:22.770 (loader): flash, block=86, bs=1024, auto=1
18:52:22.772 (loader): flash, block=87, bs=1024, auto=1
18:52:22.774 (loader): flash, block=88, bs=1024, auto=1
18:52:22.776 (loader): flash, block=89, bs=1024, auto=1
18:52:22.778 (loader): flash, block=90, bs=1024, auto=1
18:52:22.779 (loader): flash, block=91, bs=1024, auto=1
18:52:22.781 (loader): flash, block=92, bs=1024, auto=1
18:52:22.782 (loader): flash, block=93, bs=1024, auto=1
18:52:22.784 (loader): flash, block=94, bs=1024, auto=1
18:52:22.785 (loader): flash, block=95, bs=1024, auto=1
18:52:22.786 (loader): flash, block=96, bs=1024, auto=1
18:52:22.787 (loader): flash, block=97, bs=1024, auto=1
18:52:22.796 (reboot 4): status read, retry 3
18:52:22.796 (reboot 4): Success
18:52:22.796 (reboot 4): Disconnect
18:52:22.816 (loader): remote connection 1516 closed
18:52:22.816 (loader): remote connection 1504 closed
18:52:22.817 (loader): flash, block=98, bs=1024, auto=1
18:52:22.818 (loader): flash, block=99, bs=1024, auto=1
18:52:22.820 (loader): flash, block=100, bs=1024, auto=1
18:52:22.821 (loader): flash, block=101, bs=1024, auto=1
18:52:22.823 (loader): flash, block=102, bs=1024, auto=1
18:52:22.825 (loader): flash, block=103, bs=1024, auto=1
18:52:22.826 (loader): flash, block=104, bs=1024, auto=1
18:52:22.828 (loader): flash, block=105, bs=1024, auto=1
18:52:22.829 (loader): flash, block=106, bs=1024, auto=1
18:52:22.831 (loader): flash, block=107, bs=1024, auto=1
18:52:22.833 (loader): flash, block=108, bs=1024, auto=1
18:52:22.834 (loader): flash, block=109, bs=1024, auto=1
18:52:22.836 (loader): flash, block=110, bs=1024, auto=1
18:52:22.837 (loader): flash, block=111, bs=1024, auto=1
18:52:22.839 (loader): flash, block=112, bs=1024, auto=1
18:52:22.841 (loader): flash, block=113, bs=1024, auto=1
18:52:22.843 (loader): flash, block=114, bs=1024, auto=1
18:52:22.845 (loader): flash, block=115, bs=1024, auto=1
18:52:22.847 (loader): flash, block=116, bs=1024, auto=1
18:52:22.848 (loader): flash, block=117, bs=1024, auto=1
18:52:22.850 (loader): flash, block=118, bs=1024, auto=1
18:52:22.852 (loader): flash, block=119, bs=1024, auto=1
18:52:22.854 (loader): flash, block=120, bs=1024, auto=1
18:52:22.855 (loader): flash, block=121, bs=1024, auto=1
18:52:22.857 (loader): flash, block=122, bs=1024, auto=1
18:52:22.859 (loader): flash, block=123, bs=1024, auto=1
18:52:22.862 (loader): flash, block=124, bs=1024, auto=1
18:52:22.865 (loader): flash, block=125, bs=1024, auto=1
18:52:22.868 (loader): flash, block=126, bs=1024, auto=1
18:52:22.870 (loader): flash, block=127, bs=1024, auto=1
18:52:22.874 (loader): flash, block=128, bs=1024, auto=1
18:52:22.876 (loader): flash, block=129, bs=1024, auto=1
18:52:22.879 (loader): flash, block=130, bs=1024, auto=1
18:52:22.881 (loader): flash, block=131, bs=1024, auto=1
18:52:22.883 (loader): flash, block=132, bs=1024, auto=1
18:52:22.885 (loader): flash, block=133, bs=1024, auto=1
18:52:22.887 (loader): flash, block=134, bs=1024, auto=1
18:52:22.890 (loader): flash, block=135, bs=1024, auto=1
18:52:22.892 (loader): flash, block=136, bs=1024, auto=1
18:52:22.894 (loader): flash, block=137, bs=1024, auto=1
18:52:22.896 (loader): flash, block=138, bs=1024, auto=1
18:52:22.899 (loader): flash, block=139, bs=1024, auto=1
18:52:22.901 (loader): flash, block=140, bs=1024, auto=1
18:52:22.904 (loader): flash, block=141, bs=1024, auto=1
18:52:22.907 (loader): flash, block=142, bs=1024, auto=1
18:52:22.909 (loader): flash, block=143, bs=1024, auto=1
18:52:22.911 (loader): flash, block=144, bs=1024, auto=1
18:52:22.914 (loader): flash, block=145, bs=1024, auto=1
18:52:22.960 (loader): sending reboot
18:52:22.960 (loader): begin wait_until_offline
18:52:22.983 (ports 5): WM_DEVICECHANGE DBT_DEVICEREMOVECOMPLETE
18:52:22.984 (ports 5): remove: loc=usb:0/140000/0/1
18:52:22.984 (ports 5): usb_remove: usb:0/140000/0/1
18:52:22.984 (ports 5): nothing new, skipping HID & Ports enum
18:52:23.012 (loader): offline, waited 1
18:52:23.012 (loader): end operation, total time = 0.883 seconds
18:52:23.017 (loader): set background IMG_REBOOT_OK
18:52:23.020 (loader): redraw timer set, image 14 to show for 1200 ms
18:52:23.024 (loader): HID/win32: vid:044E pid:1222 ver:0108
18:52:23.025 (loader): HID/win32: vid:044E pid:1222 ver:0108
18:52:23.025 (loader): HID/win32: vid:0001 pid:0001 ver:0001
18:52:23.025 (loader): HID/win32: vid:046D pid:C21F ver:0000
18:52:23.025 (loader): HID/win32: vid:044E pid:1212 ver:B719
18:52:23.026 (loader): HID/win32: vid:00FF pid:BACC ver:0001
18:52:23.026 (loader): HID/win32: vid:00FF pid:BACC ver:0001
18:52:23.026 (loader): HID/win32: vid:044E pid:1222 ver:0108
18:52:23.118 (ports 5): WM_DEVICECHANGE DBT_DEVNODES_CHANGED
18:52:23.119 (ports 5): nothing new, skipping HID & Ports enum
18:52:24.214 (loader): redraw, image 9
18:52:24.666 (ports 5): purge, name=hid#vid_16c0&pid_0478 (Teensy 4.1) Bootloader, loc=usb:0/140000/0/1, age=1.682 sec
18:52:47.457 (loader): Verbose Info event


here is the arduino messages ( i get the same warnings in platform IO without the 9 flashing red light )

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\analysis.c:49:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\celt.c:52:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\celt_decoder.c:52:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\celt_encoder.c:52:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\opus_decoder.c:51:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\opus_encoder.c:38:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\opus_multistream.c:37:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\opus_multistream_decoder.c:40:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\opus_multistream_encoder.c:37:0:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:134:10: warning: #warning "Don't have the functions lrint() and lrintf ()." [-Wcpp]
#warning "Don't have the functions lrint() and lrintf ()."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\float_cast.h:135:10: warning: #warning "Replacing these functions with a standard C cast." [-Wcpp]
#warning "Replacing these functions with a standard C cast."
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\quant_LTP_gains.c: In function 'silk_quant_LTP_gains':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Opus4Teensy\src\quant_LTP_gains.c:132:21: warning: 'res_nrg_Q15' may be used uninitialized in this function [-Wmaybe-uninitialized]
res_nrg_Q15 = silk_RSHIFT32( res_nrg_Q15, 2 );
^
Opening Teensy Loader...
Memory Usage on Teensy 4.1:
FLASH: code:116888, data:23824, headers:8788 free for files:7976964
RAM1: variables:44960, code:113736, padding:17336 free for local variables:348256
RAM2: variables:51680 free for malloc/new:472608
Traceback (most recent call last):
File "teensy_debug", line 470, in <module>
File "teensy_debug", line 393, in runGDB
File "teensy_debug", line 285, in getPort
AttributeError: 'NoneType' object has no attribute 'group'
[9352] Failed to execute script teensy_debug
the selected serial port [9352] Failed to execute script teensy_debug
does not exist or your board is not connected
 
I should also say after I upload this sketch , I cannot repeat the upload. I have to upload blink , or another example project and then I get back the usb port.
 
I added my library to C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries

and compiled with Arduino 1.8.19 & Teensyduino 1.57

here is the code including the .ino file

https://github.com/benbiles/opus4arduinoTeensy

the only change I made is to add these defines in this header file and include it in all files in the library.
https://github.com/benbiles/opus4arduinoTeensy/blob/main/src/global_lib_defines.h

as I said the problem happens after build and upload in the arduino platform , its working in platform IO
 
thanks Rezo , think I'll try a few older versions a see if I get lucky, will report back if it works.. no snooze code or TEENSY40\hal.c file in TD1.57
 
I'm not sure at all what the root cause might be, but I remember having 9 blinks with Snooze after updating to TD1.56 - it might give you some ideas
You can see here:
https://forum.pjrc.com/threads/69432-Snooze-not-working-with-any-T4-x-on-TD1-56

UPDATE , the downgrade to 1.8.13 and TD 1.54 worked.

PaulStoffregen I will try later versions when I get time and try to work out what version breaks my library

thanks again Rezo , I have no idea what is broken in the later releases or what version breaks it !

I will try a newer version combination when I get time and see what is the latest working combo
 
Back
Top