Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) cannot debug a teensy project , red flashing light and serial port lost (Read 4551 times)
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
cannot debug a teensy project , red flashing light and serial port lost
Aug 10th, 2022 at 1:55am
Print Post  
Hi,

firstly , I can debug and display variables in a slightly modified blink project ( I just added a variable counter and display results from a break point )

I go to my more complex project and after the code builds and uploads the teensy 4.1 flashes its red light and fails to be detected in either VMICO or arduino IDE.

the project I am trying to build is here:
https://github.com/mgergos/Opus4Teensy

I have added build flags set and in the attached log.

I have a ton of errors in the error list but the project appears to build and upload ?

The project builds and works in project IO. there are more errors than this but cannot fit in this forum page as max size reached.
Code
Select All
Severity	Code	Description	Project	File	Line	Suppression State
Error (active)	E0035	#error directive: Unknown compiler	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	316
Error (active)	E0035	#error directive: Unknown compiler	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	494
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	537
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	537
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	621
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	634
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	641
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	641
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	672
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	685
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	686
Error (active)	E0020	identifier "arm_fir_instance_q7" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	1100
Error (active)	E0070	incomplete type is not allowed	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	1114
Error (active)	E0020	identifier "arm_fir_instance_q7" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	1115
Error (active)	E0020	identifier "S" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	1115
Error (active)	E0254	type name is not allowed	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	1116
Error (active)	E0018	expected a ')'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	1116
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4820
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4820
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4879
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4879
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4882
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4883
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4929
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4929
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4932
Error (active)	E0020	identifier "__SSAT" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4932
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4935
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4935
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4936
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4936
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4937
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4937
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4940
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	4941
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5012
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5012
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5109
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5109
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5219
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5219
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5279
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5332
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5332
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5392
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5458
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5458
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5499
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5545
Error (active)	E0020	identifier "pYData" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5545
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5546
Error (active)	E0020	identifier "pYData" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5546
Error (active)	E0852	expression must be a pointer to a complete object type	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5546
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5549
Error (active)	E0020	identifier "fract" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5549
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5552
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5552
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5555
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5556
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5603
Error (active)	E0020	identifier "pYData" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5603
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5604
Error (active)	E0020	identifier "pYData" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5604
Error (active)	E0852	expression must be a pointer to a complete object type	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5604
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5607
Error (active)	E0020	identifier "fract" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5607
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5610
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5610
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5613
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5614
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5660
Error (active)	E0020	identifier "pYData" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5660
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5661
Error (active)	E0020	identifier "pYData" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5661
Error (active)	E0852	expression must be a pointer to a complete object type	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5661
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5664
Error (active)	E0020	identifier "fract" is undefined	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5664
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5667
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5667
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5670
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5671
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5770
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5770
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5795
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5830
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5830
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5863
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5863
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5864
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5868
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5908
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5913
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5920
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5924
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5963
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5963
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5964
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	5968
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	6013
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	6020
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	6024
Error (active)	E0077	this declaration has no storage class or type specifier	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	6063
Error (active)	E0065	expected a ';'	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	6063
Error (active)	E0169	expected a declaration	OPUS_TX	C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\arm_math.h	6064
 

« Last Edit: Nov 18th, 2022 at 9:18pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #1 - Aug 10th, 2022 at 2:00am
Print Post  
I should also say , the project uploads when I push the hardware button on the teensy. so maybe the errors are preventing auto upload?

when I build / upload blink example , the project is auto uploaded and debugging is working without loosing the port.

Perhaps I am just forcing a build that has errors into the teensy and its crashing on boot ? maybe a segment fault ?

I am not sure why the project has so many errors in arm_math.h when platform IO biulds without these errors.

arm_math is listed in the project in the external dependencies list in the solution explorer window.

* Project:      CMSIS DSP Library
* Title:        arm_math.h
* Description:  Public header file for CMSIS DSP Library
*
* $Date:        27. January 2017
* $Revision:    V.1.5.1
*
* Target Processor: Cortex-M cores

I presume my code depends on CMSIS DSP cortex and comes with arduino for teensy.




« Last Edit: Aug 10th, 2022 at 2:05am by benyboy »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #2 - Aug 10th, 2022 at 8:24am
Print Post  
Thanks for the report, can you attach the complete output from a build with the options set as shown in the yellow box at the top of the page so we can replicate correctly?
  
Back to top
 
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #3 - Aug 10th, 2022 at 11:04am
Print Post  
hi , I think I attached this to my 1st post ? if you search OPUS_BUILD in the log the flags come up.

here's a list of includes the project required to build. there all installed to Arduino teensy libraries folder and then I point to then I imported them through visual micro.

// Demo code for Opus Encode/Decode for Teensy 4.0
// 

#include <sdios.h>
#include <SdFatConfig.h>
#include <SdFat.h>
#include <RingBuf.h>
#include <MinimumSerial.h>
#include <FreeStack.h>
#include <BufferedPrint.h> 
#include <SD.h>
#include <SerialFlash.h>
#include <_kiss_fft_guts.h>
#include <vq.h>
#include <typedef.h>
#include <tuning_parameters.h>
#include <tansig_table.h>
#include <tables.h>
#include <structs_FIX.h>
#include <structs.h>

//#include <static_modes_float_arm_ne10.h>
//#include <static_modes_float.h>
// #include <static_modes_fixed_arm_ne10.h>
//#include <static_modes_fixed.h>

#include <stack_alloc.h>
#include <SigProc_FIX.h>
#include <resampler_structs.h>
#include <resampler_rom.h>
#include <resampler_private.h>
#include <rate.h>
#include <quant_bands.h>
#include <PLC.h>
#include <pitch_est_defines.h>
#include <pitch.h>
#include <os_support.h>
#include <opus_types.h>
#include <opus_private.h>
#include <opus_multistream.h>
#include <opus_defines.h>
#include <opus_custom.h>
#include <opus.h>
#include <NSQ.h>
#include <modes.h>
#include <mlp.h>
#include <mfrngcod.h>
#include <mdct.h>
#include <mathops.h>
#include <main_FIX.h>
#include <main.h>
#include <macros.h>
#include <MacroDebug.h>
#include <MacroCount.h>
#include <laplace.h>
#include <kiss_fft.h>
#include <Inlines.h>
#include <float_cast.h>
#include <fixed_generic.h>
//#include <fixed_debug.h>
#include <errors.h>
#include <entenc.h>
#include <entdec.h>
#include <entcode.h>
#include <ecintrin.h>
#include <define.h>
#include <debug.h>
#include <cwrs.h>
#include <cpu_support.h>
#include <control.h>
#include <config.h>
#include <celt_lpc.h>
#include <celt.h>
#include <bands.h>
#include <arch.h>
#include <API.h>
#include <analysis.h>
#include <synth_whitenoise.h>
#include <synth_wavetable.h>
#include <synth_waveform.h>
#include <synth_tonesweep.h>
#include <synth_sine.h>
#include <synth_simple_drum.h>
#include <synth_pwm.h>
#include <synth_pinknoise.h>
#include <synth_karplusstrong.h>
#include <synth_dc.h>
#include <spi_interrupt.h>
#include <Resampler.h>
#include <record_queue.h>
#include <Quantizer.h>
#include <play_serialflash_raw.h>
#include <play_sd_wav.h>
#include <play_sd_raw.h>
#include <play_queue.h>
#include <play_memory.h>
#include <output_tdm2.h>
#include <output_tdm.h>
#include <output_spdif3.h>
#include <output_spdif2.h>
#include <output_spdif.h>
#include <output_pwm.h>
#include <output_pt8211_2.h>
#include <output_pt8211.h>
#include <output_mqs.h>
#include <output_i2s_quad.h>
#include <output_i2s_oct.h>
#include <output_i2s_hex.h>
#include <output_i2s2.h>
#include <output_i2s.h>
#include <output_dacs.h>
#include <output_dac.h>
#include <output_adat.h>
#include <mixer.h>
#include <memcpy_audio.h>
#include <input_tdm2.h>
#include <input_tdm.h>
#include <input_spdif3.h>
#include <input_pdm_i2s2.h>
#include <input_pdm.h>
#include <input_i2s_quad.h>
#include <input_i2s_oct.h>
#include <input_i2s_hex.h>
#include <input_i2s2.h>
#include <input_i2s.h>
#include <input_adcs.h>
#include <input_adc.h>
#include <filter_variable.h>
#include <filter_ladder.h>
#include <filter_fir.h>
#include <filter_biquad.h>
#include <effect_waveshaper.h>
#include <effect_wavefolder.h>
#include <effect_reverb.h>
#include <effect_rectifier.h>
#include <effect_multiply.h>
#include <effect_midside.h>
#include <effect_granular.h>
#include <effect_freeverb.h>
#include <effect_flange.h>
#include <effect_fade.h>
#include <effect_envelope.h>
#include <effect_delay_ext.h>
#include <effect_delay.h>
#include <effect_combine.h>
#include <effect_chorus.h>
#include <effect_bitcrusher.h>
#include <control_wm8731.h>
#include <control_tlv320aic3206.h>
#include <control_sgtl5000.h>
#include <control_cs4272.h>
#include <control_cs42448.h>
#include <control_ak4558.h>
#include <biquad.h>
#include <AudioControl.h>
#include <async_input_spdif3.h>
#include <analyze_tonedetect.h>
#include <analyze_rms.h>
#include <analyze_print.h>
#include <analyze_peak.h>
#include <analyze_notefreq.h>
#include <analyze_fft256.h>
#include <analyze_fft1024.h>
#include <ADC.h>
#include <output_opus_enc.h>
#include <input_opus_dec.h>
#include <Arduino.h>
#include <Wire.h>
#include <Audio.h>

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2175
Joined: Feb 13th, 2019
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #4 - Aug 10th, 2022 at 11:09am
Print Post  
Thanks for the detail and logs, sorry for missing this on the first post.

We will investigate the errors, however if you switch the Error Window to only show Build Errors, does this reduce the number shown? (I suspect they are all intellisense errors)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #5 - Aug 10th, 2022 at 9:52pm
Print Post  
Please Ensure the defines are set at Global not Configuration.. Then switch to releae mode, click "Build>Clean Solution" then build and send the output again. 

Also confirm if you have the same list of includes for that library in your platformIO code.

Thanks
« Last Edit: Aug 10th, 2022 at 9:55pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #6 - Aug 11th, 2022 at 12:40am
Print Post  
Hi , I built the project as release with build flag defines in global and attached the file.

I also removed unnecessary includes which visual micro added to the project file when I added the libraries and only include the required headers from original project.

these are;

#include <Arduino.h>
#include <Wire.h>
#include <Audio.h>

#include <output_opus_enc.h>
#include <input_opus_dec.h>

the project builds successfully with this error in errir list
Severity      Code      Description      Project      File      Line      Suppression State
Error (active)      E0992      command-line error: invalid macro definition: OVERRIDE_OPUS_FREE-D      OPUS_TX      C:\Users\ben\Documents\Arduino\OPUS_TX\OPUS_TX.ino      1      


If I hook up Teensy with blink flashed before from arduino, then it will compile and upoad my project BUT it still won't debug.

If I re-compile / upload I have to press hardware button for it to upload again and then I get the flashing red lights on the USB side.



  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #7 - Aug 11th, 2022 at 12:50am
Print Post  
Thanks, it is standard for the headers to be added in Visual Micro and the Arduino IDe unless the library specifies a more limited list.

If you compile and upload blink with visual micro does that also work? Does compiling and uploading blink using visual micro a second time also work okay?

ignore the debug side of things while we answer this thanks
« Last Edit: Aug 11th, 2022 at 12:53am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #8 - Aug 11th, 2022 at 1:59pm
Print Post  
Hi , yes I can compile / upload blink multiple times in a row without needing to press the manual upload button.

I added to blink

int x = 1; 

loop() {
x++;
}

I can watch variable x increment



« Last Edit: Aug 11th, 2022 at 2:00pm by benyboy »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #9 - Aug 11th, 2022 at 6:00pm
Print Post  
Great thanks. 

The output you posted shows a cached build for release. Can you click "Build>Clean Solution" then build and give the output. It needs to be the first build after a clean to ensure a full compile.

  
Back to top
WWW  
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #10 - Aug 12th, 2022 at 5:11am
Print Post  
no problem, makes sense..
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #11 - Aug 12th, 2022 at 9:44am
Print Post  
sorry the build log before was clean project , this one is clean solution. I attached it again in case there is a difference.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #12 - Aug 12th, 2022 at 1:22pm
Print Post  
Thanks, we can see the lib is being built with the defines you have set. It sounds like the library is killing the board. We can try to do some testing next week but it might be an idea to ask the library author for assistance. We are compiling the library as a normal arduino library but with the extra defines (that can not normally be set in the arduino ide unless we edit the build pattern).

With Arduino, there is also option to pre-compile the library into a ".a" archive if the defines are causing the issue.  In this current test. the defines are applied to all project, library and core code, not just the specific library.

Here is the example build pattern for one of the library.

Code
Select All
Using library opus-1.2.1 version 0.0.0 in folder 1.2.1"
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-gcc" -c -Og -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -Dopus_free(x)=NULL -Dopus_alloc(x)=NULL -DOPUS_ARM_ASM -DEMBEDDED_ARM -DOPUS_ARM_INLINE_EDSP -DDISABLE_FLOAT_API -DOVERRIDE_OPUS_ALLOC_SCRATCH -DHAVE_CONFIG_H -DVAR_ARRAYS -DOVERRIDE_OPUS_FREE -DOVERRIDE_OPUS_ALLOC -DFIXED_POINT -DOPUS_BUILD -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=108019 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\Audio\1.3\Audio" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\OPUS_TX\0.0.0\OPUS_TX"  -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\SD\2.0.0\SD\src" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\SdFat\2.1.2\SdFat\src" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\SPI\1.0\SPI"  -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire\utility" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\Audio\1.3\Audio\utility" NLSF.c" -o NLSF.c.o"
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-gcc" -c -Og -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -Dopus_free(x)=NULL -Dopus_alloc(x)=NULL -DOPUS_ARM_ASM -DEMBEDDED_ARM -DOPUS_ARM_INLINE_EDSP -DDISABLE_FLOAT_API -DOVERRIDE_OPUS_ALLOC_SCRATCH -DHAVE_CONFIG_H -DVAR_ARRAYS -DOVERRIDE_OPUS_FREE -DOVERRIDE_OPUS_ALLOC -DFIXED_POINT -DOPUS_BUILD -D__IMXRT1062__ -DTEENSYDUINO=157 -DARDUINO=108019 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\Audio\1.3\Audio" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\OPUS_TX\0.0.0\OPUS_TX"  -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\SD\2.0.0\SD\src" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\SdFat\2.1.2\SdFat\src" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\SPI\1.0\SPI"  -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" -I"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire\utility" -I"C:\Users\ben\Documents\Arduino\OPUS_TX\Libraries\Audio\1.3\Audio\utility" alysis.c" -o alysis.c.o" 

« Last Edit: Aug 12th, 2022 at 1:22pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #13 - Aug 13th, 2022 at 1:14am
Print Post  
I posted the question on the library github to see if there are any more clues as to why arduino IDE does not like the global defines. 

I'd much appreciate it if you could try targeting the defines to just the lib. but understand it could be more of an arduino IDE shortfall than a vissual micro one.
 
https://github.com/mgergos/Opus4Teensy

platform IO auto generates this json from platform.ini file. I don't know if that's of any use to visual micro.




            "defines": [
                "PLATFORMIO=60103",
                "__IMXRT1062__",
                "ARDUINO_TEENSY40",
                "USB_DUAL_SERIAL",
                "OPUS_BUILD",
                "FIXED_POINT",
                "OVERRIDE_OPUS_ALLOC",
                "OVERRIDE_OPUS_FREE",
                "VAR_ARRAYS",
                "HAVE_CONFIG_H",
                "OVERRIDE_OPUS_ALLOC_SCRATCH",
                "DISABLE_FLOAT_API",
                "OPUS_ARM_INLINE_EDSP",
                "EMBEDDED_ARM",
                "OPUS_ARM_ASM",
                "opus_alloc(x)=NULL",
                "opus_free(x)=NULL",
                "ARDUINO=10805",
                "TEENSYDUINO=156",
                "CORE_TEENSY",
                "F_CPU=600000000",
                "LAYOUT_US_ENGLISH",
                "__PLATFORMIO_BUILD_DEBUG__",
                ""
            ],
            "cppStandard": "c++14",
            "compilerPath": c.exe",
            "compilerArgs": [
                "-mthumb",
                "-mcpu=cortex-m7",
                "-mfloat-abi=hard",
                "-mfpu=fpv5-d16",
                ""
            ]
        }
  
Back to top
 
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #14 - Aug 17th, 2022 at 1:52am
Print Post  
got stuck building .a pre compiled files for library and the library isn't really maintained or designed for arduino.

I think the solution is to design the lib for proper use in  arduino in the 1st place. 

I have made a .h file with the defines and have included that to every file in the library.

I have a few errors doing this but will report back here if I get this library working natively for arduino which will hopefully allow me to use breakpoints with visual micro.

thanks for your help understanding this.



  
Back to top
 
IP Logged
 
benyboy
Junior Member
**
Offline


Posts: 13
Joined: Aug 4th, 2022
Re: cannot debug a teensy project , red flashing light and serial port lost
Reply #15 - Aug 17th, 2022 at 3:18pm
Print Post  
the project builds now without errors ( there were some #if XYZ rather than #ifdef which caused some c++ errors). The defines are built into the library , but when I upload either in Arduino IDE or visual micro I still get the red flashing lights on USB port. I think I might ask questions on the Arduino forum. Its strange the same project builds and uploads from platformIO but when I check the GCC flags they all look the same as the ones in the teensy arduino boards.txt file. 


will report back if I get anywhere.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint