Forum Rule: Always post complete source code & details to reproduce any issue!
Page 160 of 175 FirstFirst ... 60 110 150 158 159 160 161 162 170 ... LastLast
Results 3,976 to 4,000 of 4361

Thread: Teensy 4.0 First Beta Test

  1. #3976
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Last night I cleaned up the I2S code, testing on both Teensy 3.6 and 4.0.

    Right now I'm working on putting the native SD code back to polling mode. It's working great on Teensy 3.6 with the audio lib (as it used to in version 1.45), but that breaks it on Teensy 4.0. So far, I can't figure out why...

    Today is my first day since release where we're not frantically shipping orders. I hope to clean the rest of the immediate software issue up later today.

  2. #3977
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,236
    Quote Originally Posted by PaulStoffregen View Post

    Right now I'm working on putting the native SD code back to polling mode. It's working great on Teensy 3.6 with the audio lib (as it used to in version 1.45), but that breaks it on Teensy 4.0. So far, I can't figure out why...
    Re: WavFilePlayer and BUILTIN_SDCARD
    Yeah, a few weeks back I tried to figure out how to get SD lib to do polling again, even just polling on DMA done, but it was above my pay grade.

    Good work on getting the T4 out to the world.

  3. #3978
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    137

    What is a 'section type conflict' that shows up with 1.47-beta5 only on T4

    Code:
    PROGMEM const int mphTable[] = {
    0,100,90,80,75,60,
    4,1,1,1,1,1,
    5,1,1,1,1,1,
    6,1,1,1,1,1,
    7,1,1,1,1,3,
    8,1,1,2,2,5,
    9,1,1,3,4,7,
    10,1,2,4,5,9,
    11,2,4,5,7,9,
    12,3,5,7,8,10,
    13,4,6,8,9,12,
    14,5,8,9,9,13,
    15,7,9,10,10,14,
    16,8,9,11,11,16,
    17,9,10,12,12,17,
    18,9,11,13,13,18
    };
    
    PROGMEM const char *toplineTABLE[]={
    "error",
    " ",
    "BATTERY",
    "AUTO",
    "MODE",
    "ADJUST FRONT",
    "ADJUST BACK",
    "ADJUST AUTO",
    "MOVE TO MID GR2",
    "SETTINGS"
    };
    
    void setup() {
      // put your setup code here, to run once:
    
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
      gearfromMphTable(12,2);
    }
    
    int gearfromMphTable(int thespeed, int rpmoffset){
      int thegear;
    
      thegear=pgm_read_word_near(mphTable+(thespeed-3)*6+rpmoffset); //for table with rpms in first row, starting with 4mph in second
      return thegear;
    }
    RESULT:
    T4issue_PROGRAM:21: error: toplineTABLE causes a section type conflict with mphTable
    PROGMEM const char *toplineTABLE[]={
    ^
    /var/folders/b9/m7vp5hr925n_3r73_y07979w0000gn/T/arduino_modified_sketch_22662/T4issue_PROGRAM.ino:2:19: note: 'mphTable' was declared here
    PROGMEM const int mphTable[] = {
    ^
    toplineTABLE causes a section type conflict with mphTable

    I found some information here: https://forum.pjrc.com/threads/54711...l=1#post197693 but no solution.
    Last edited by bicycleguy; 08-11-2019 at 08:18 PM. Reason: cut n paste error & only on T4

  4. #3979
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,290
    It is essentially a memory fault error where PROGMEM somehow is going into the wrong section of memory on the T4. T4 memory is rather confusing to me but from what I understand on the T4 there are 4 blocks of memory:
    Code:
    - ITCM (@0x0, 256KB fast RAM, uncached) is 256KB and intended for code. 
    - DTCM (@0x20000000, 256Kb fast RAM, uncached) is intendeded for data, 
    - OTCM (@0x20200000, 512 KB RAM connected via a slower bus, can be cached) for data, 
    - Flash, @0x60000000, size defined by the external chip for code & data, can be cached.
    - inbuilt devices
    curtesy of @Frank B.

    But if you haven't figure it out the correct format your progmem block is:
    Code:
    const char *const toplineTABLE[] PROGMEM = {
    got that from going to the Arduino Progmem help page.

  5. #3980
    Senior Member
    Join Date
    May 2015
    Posts
    386
    Not sure if itís feasible or maybe you even already have a tool similar to rustís cargo crater tool their development team uses to test releases. Basically it tryís to compile thousands of libraryís In The cargo library and seís how many have errors and the get a list. Maybe you have such a tool not to check not if it functions correctly but if I gives build errors?

  6. #3981
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Quote Originally Posted by DaQue View Post
    Maybe you have such a tool not to check not if it functions correctly but if I gives build errors?
    Yes, I wrote such a script 2 years ago. Recently updated it for Teensy 4.0.

    https://github.com/PaulStoffregen/Ve...uino_Libraries

  7. #3982
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    137
    Quote Originally Posted by mjs513 View Post
    It is essentially a memory fault error where PROGMEM somehow is going into the wrong section of memory on the T4. T4 memory is rather confusing to me but from what I understand on the T4 there are 4 blocks of memory:
    Code:
    - ITCM (@0x0, 256KB fast RAM, uncached) is 256KB and intended for code. 
    - DTCM (@0x20000000, 256Kb fast RAM, uncached) is intendeded for data, 
    - OTCM (@0x20200000, 512 KB RAM connected via a slower bus, can be cached) for data, 
    - Flash, @0x60000000, size defined by the external chip for code & data, can be cached.
    - inbuilt devices
    curtesy of @Frank B.

    But if you haven't figure it out the correct format your progmem block is:
    Code:
    const char *const toplineTABLE[] PROGMEM = {
    got that from going to the Arduino Progmem help page.
    Wow, I really don't understand that callout or the array of strings method on the Arduino PROGMEM help page, but it compiles and seems to work. I'll investigate further, thanks!

  8. #3983
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,365
    Quote Originally Posted by bicycleguy View Post
    Wow, I really don't understand that callout or the array of strings method on the Arduino PROGMEM help page, but it compiles and seems to work. I'll investigate further, thanks!
    In the 8-bit AVR systems (such as the Arduino Uno), data space is rather limited, and things in read-only flash memory (i.e. the program) are not in the same address space as the data pointers. So if you have a bunch of strings or a table of constant values, you might want to put that read only table in the flash memory, and then use special functions to copy that string or data from the program space to the data space when you need the string/number, and then when you are done, you reuse the space.

    On ARM systems, the data and program are in the same address space. So you don't need the functions, but you want to use the const keyword so that the compiler/linker puts that table into read-only flash memory, and not the read-write data space. In Teensy 3, the PROGMEM macro was empty, but in Teensy 4, it uses an __attribute__ to tell the linker that the stuff needs to be linked so it is in lower memory. This is because while they share the same address space, the lower and upper memories for the Teensy 4 have different characteristics.

  9. #3984
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Quote Originally Posted by manitou View Post
    Yeah, a few weeks back I tried to figure out how to get SD lib to do polling again, even just polling on DMA done, but it was above my pay grade.
    Must admit, I've also been stuck on this for many hours. I believe I finally got it working. Here's the changes.

    https://github.com/PaulStoffregen/SD...44a1fe94fecae5

    Most of this commit is just putting the old polling code back, and commenting out the DMA+interrupt code.

    The tricky part threw me for so long was the MIX_CTRL register. Teensy 3.6's SDHC controller doesn't have this register at all. If you look at the register list (page 2005-2006 in the K66 manual), there's a hole at offset 0x48. Teensy 4.0 does have this register, at offset 0x48. Interestingly, neither of them has anything documented at offset 0x4C...

    On Teensy 3.6, the 4 data line drivers seem to become input or output based on the XFERTYP bit DTDSEL, which happens inside the SDHC_CMD_Do() function. On Teensy 4.0, it seems you also need to write to the (seemingly redundant) MIX_CTRL bit DTDSEL, before starting the command.

    Hopefully nobody will ever need to mess with this. But here's a message about the problem just in case I or you or anything else runs across this again.

    I'm listening to the WavFilePlayer running on Teensy 4.0 with the SD card on the breakout board socket.

  10. #3985
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,236
    Well done. I installed your latest SD lib and confirmed WavFilePlayer with BUILTIN_SDCARD worked on T4 and T3.5. Also confirmed listfiles example worked. Whew.

  11. #3986
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Quote Originally Posted by mjs513 View Post
    On new load always seems to load T3.2 as the selected board.
    I'm fixing this now. Will upload 1.47-beta6 later today.

    Looking to finalize 1.47 on Monday.

  12. #3987
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,290
    Quote Originally Posted by PaulStoffregen View Post
    I'm fixing this now. Will upload 1.47-beta6 later today.

    Looking to finalize 1.47 on Monday.
    Not a problem Paul. Know you have had your hands full

    Anyway, downloaded the SD Lib changes you made and Datalogger and Dumpfile are both now working again on the T4B2R. Great work on finding the problem.

  13. #3988
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    137
    @wwatson
    Quote Originally Posted by wwatson View Post
    ...
    Installed a fresh copy of Arduino 1.8.9 and TD 1.47B5. I was compiling one of my test programs that use the time library and got an error.
    So I tried compiling 'TimeRTC.ino' and it gave the same error below:
    ...
    I searched for 'strcpy_P' in the compiler libs but did not find it.
    I changed line 20 in 'DateStrings.cpp' to this:
    Code:
    #if defined(ESP8266) || defined(ARDUINO_ARCH_ESP32) || defined(__IMXRT1062__)
    It compiled ok after that.
    Can't wait for the T4 release
    Same issue with TimeLib.h on Teensy 3.2 and Teensy 4 with 1.47-beta5. Worked on 1.46

    thanks
    Last edited by bicycleguy; 08-12-2019 at 12:30 AM. Reason: added 3.2 and version info

  14. #3989
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Quote Originally Posted by defragster View Post
    > Adafruit_GFX - new version from AdaFruit works for compiling on T4 - at least against the ST7789 code I tested - where the beta 5 version did not
    I've pulled in the latest Adafruit_GFX. I did a quick test with their Adafruit_ILI9341 lib, on Teensy 3.2 and 4.0. Seems to work fine.

    Going to package up 1.47-beta6 shortly. Hoping you can try some other displays tonight or tomorrow.


    > i2s (?) bad #ifdef led to compile breakage
    Fixed.

    > After install first Arduino startup returned to T_3.2, not last used T4.
    Fixed.

    Also fixed (hopefully) all the remaining "Beta2" to now say Teensy 4.0, like with detecting the boards in the Ports menu. 1.47-beta6 will also show a real image of the Teensy 4.0 hardware, rather than this chip picture we've see for so long.

    Name:  beta2.png
Views: 267
Size:  9.8 KB

  15. #3990
    Senior Member
    Join Date
    Nov 2017
    Location
    Belgium
    Posts
    152
    In beta5, output_i2s.cpp is missing line 507
    Code:
    void AudioOutputI2Sslave::config_i2s(void)
    {
    #if defined(KINETISK) //<-- missing
    	SIM_SCGC6 |= SIM_SCGC6_I2S;
    which prevents it from compiling.

  16. #3991
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Quote Originally Posted by bicycleguy View Post
    Same issue with TimeLib.h on Teensy 3.2 and Teensy 4 with 1.47-beta5.
    Fixed

    https://github.com/PaulStoffregen/Ti...e0836b037a58b2

  17. #3992
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Quote Originally Posted by neurofun View Post
    In beta5, output_i2s.cpp is missing line 507
    Fixed. Code is on github. Will package up beta6 soon....

  18. #3993
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,079
    Paul - also for release ::

    >> what of ...\hardware\teensy\avr\cores\teensy4\debug\printf.h and #define PRINT_DEBUG_STUFF

    Not sure if anything else would have to get resolved for release version?

    NOTE: When you turn that off there will be warnings last seen in the Fault_Handler code from the debug print gone missing.

    >> ...\hardware\teensy\avr\cores\teensy4\startup.c :: void HardFault_HandlerC(unsigned int *hardfault_args) {

    But will that code be #ifdef out for a NULL handler? that perhaps just does this?
    Code:
    	if ( F_CPU_ACTUAL >= 600000000 )
    		set_arm_clock(100000000); // 100 or 200 or 300?
    	while (1) asm ("WFI");
    >> and there this is unused code :: void PJRCunused_interrupt_vector(void)

    >> Also unused in startup.c :: __attribute__((weak)) void userDebugDump(){

  19. #3994
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    I've uploaded 1.47-beta6. Links on msg #2.

    Please give this a try, on Teesny 4.0 and also on older boards. Is anything still broken?

    You may notice I pruned the USB Type and Optimize menus. As those things are implemented on Teensy 4.0, will add them back. They're just commended in boards.txt, so easy to uncomment if you want them.

    I'm going to try porting a couple more libs, and of course fix any more bugs that turn up. Really want to wrap up 1.47 tomorrow, so we have a stable release with Teensy 4.0 support.

    If you have a moment to give 1.47-beta6 a try, please let me know if there's any other bugs I really should fix before releasing it tomorrow?

  20. #3995
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,786
    Quote Originally Posted by defragster View Post
    >> what of ...\hardware\teensy\avr\cores\teensy4\debug\printf.h and #define PRINT_DEBUG_STUFF
    I turned off the Serial4 debug printing for 1.47-beta6.

    https://github.com/PaulStoffregen/co...fa000e59119b07


    NOTE: When you turn that off there will be warnings last seen in the Fault_Handler code from the debug print gone missing.
    Yup, already fixed.

    https://github.com/PaulStoffregen/co...70fa73f8ed13f9

  21. #3996
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,079
    Quote Originally Posted by PaulStoffregen View Post
    I turned off the Serial4 debug printing for 1.47-beta6.

    https://github.com/PaulStoffregen/co...fa000e59119b07




    Yup, already fixed.

    https://github.com/PaulStoffregen/co...70fa73f8ed13f9
    Cool - will do a clean install of 1.8.9 and 1.47 ...

  22. #3997
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,079
    Did a fresh UNZIP of IDE 1.8.9 and then TD 1.47b6. To confirm my sketchbook\libraries folder is EMPTY

    First couple of things okay so far then ...

    What's up with : "arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3\e xamples\graphicstest\graphicstest.ino"
    .. and same with "arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3\e xamples\DemoSauce\DemoSauce.ino"

    "T:\\arduino-1.8.9t4\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=147 -DARDUINO=10809 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IT:\\TEMP\\arduino_build_408666/pch" "-IT:\\arduino-1.8.9t4\\hardware\\teensy\\avr\\cores\\teensy4" "-IT:\\arduino-1.8.9t4\\hardware\\teensy\\avr\\libraries\\SPI" "-IT:\\arduino-1.8.9t4\\hardware\\teensy\\avr\\libraries\\ILI9341 _t3" "T:\\TEMP\\arduino_build_408666\\sketch\\graphicst est.ino.cpp" -o "T:\\TEMP\\arduino_build_408666\\sketch\\graphicst est.ino.cpp.o"
    In file included from T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3\e xamples\graphicstest\graphicstest.ino:18:0:

    T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoNotFull()':
    T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h:320:9: error: 'KINETISK_SPI0' was not declared in this scope
    sr = KINETISK_SPI0.SR;
    ^
    T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoEmpty()':
    T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h:328:9: error: 'KINETISK_SPI0' was not declared in this scope
    sr = KINETISK_SPI0.SR;

    // ...

    T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h:374:68: error: 'SPI_PUSHR_EOQ' was not declared in this scope
    KINETISK_SPI0.PUSHR = d | (pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_EOQ;
    ^

    Using library SPI at version 1.0 in folder: T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\SPI
    Using library ILI9341_t3 at version 1.0 in folder: T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\ILI9341_t3
    Error compiling for board Teensy 4.0.
    Update>> installed & tested ' #include "Adafruit_ILI9341.h" ' : Paul noted he tested that and T4 works with that ili9341
    Code:
    Using library SPI at version 1.0 in folder: T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\SPI 
    Using library Adafruit_GFX at version 1.5.6 in folder: T:\arduino-1.8.9t4\hardware\teensy\avr\libraries\Adafruit_GFX 
    Using library Adafruit_ILI9341 at version 1.5.1 in folder: T:\tCode\libraries\Adafruit_ILI9341 
    > Looking at the <XPT2046_Touchscreen.h> - for TouchTestIRQ.ino - oddly without touch the SPI SCLK LED is flickering?
    Last edited by defragster; 08-12-2019 at 05:21 AM.

  23. #3998
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    137
    Quote Originally Posted by PaulStoffregen View Post
    I've uploaded 1.47-beta6. Links on msg #2.

    Please give this a try, on Teesny 4.0 and also on older boards. Is anything still broken?

    ...
    I can confirm that RSL_VNA, and a bunch of ILI9341_t3.h based programs run on T3.5 (touchpoint, graphicstest, demosauce ...) and compile on 4.0
    Teensy_Convolution_SDR didn't compile on T3.6 or t4 as it requires a little fooling around with libraries I didn't have time to do.

    All of the older programs I tested worked with beta6 and at least compiled with T4.

    Have an issue where serial.write(0x04); works but serial.write(0x00) on T4 gives 'call of overloaded 'write(int)' is ambiguous' which can be fixed with a (uint8_t) cast

    Overall beta5 was a no-go for me but beta6 seems respectable.

  24. #3999
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,290
    @defragsrer
    Not at computer now but did $KurtEs PR get pulled in for the 9441_t3 lib? If not it won't work.

  25. #4000
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,079
    Quote Originally Posted by mjs513 View Post
    @defragsrer
    Not at computer now but did $KurtEs PR get pulled in for the 9441_t3 lib? If not it won't work.
    I'm suspecting it did not get pulled in - was hoping KurtE might be online and see this to confirm.
    >> Nothing OPEN for @KurtE - one closed July 2nd ?? :: https://github.com/PaulStoffregen/SP...3Aopen+is%3Apr

    @bicycleguy - any chance you have a sketchbook\libraries copy of a WIP SPI on your system?
    <EDIT> from post #4003 - not SPI but ILI9341_t3 ?
    >> @bicycleguy - is there a local libraries version of WIP ILI9341_t3 in sketchbook?
    Last edited by defragster; 08-12-2019 at 08:30 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •