Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 51 to 75 of 92

Thread: Teensyduino 1.54 Beta #6

  1. #51
    Quote Originally Posted by Paul View Post
    Update FlexCAN_t4
    Thank you for this!!

  2. #52
    I posted a thread in the audio forums, but since it concerns 1.54 beta 6 and the new integration with SDFat, I'm linking to it here.
    The 5 second version is that calling SDCard.read() in SDIO mode with T4.1's built-in card seems to cause audio glitches, even if the data read is not used for audio. If this is a known issue or a limitation of the hardware, please disregard!

    Thanks,
    -J

  3. #53
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    Quote Originally Posted by Frank B View Post
    If we use the elf, we can replace the normal size tool.. do you have a link to the code?
    Here is the elf parsing code.

    https://github.com/PaulStoffregen/teensy_size

    Want the final result to be compact in the non-verbose mode, probably 1 line per memory region shown on the product page (so 3 lines for Teensy 4.0, 4 lines for Teensy 4.1). Exact format to be determined....

  4. #54
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,407
    Quote Originally Posted by PaulStoffregen View Post
    Here is the elf parsing code.

    https://github.com/PaulStoffregen/teensy_size

    Want the final result to be compact in the non-verbose mode, probably 1 line per memory region shown on the product page (so 3 lines for Teensy 4.0, 4 lines for Teensy 4.1). Exact format to be determined....
    As said a few posts later, I don't think we can simply replace the size-tool. The builder prints a defined text and gets its data by using the regexs on the output.
    So we need an extra tool - but then, we don't need to parse the elf-file. There is one minor disadvantage: The "used libraries" text is printed after our size-output.
    But maybe that's even better...?

  5. #55
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    Quote Originally Posted by Frank B View Post
    As said a few posts later, I don't think we can simply replace the size-tool. The builder prints a defined text and gets its data by using the regexs on the output.
    I'm kinda hoping for a replacement. Committed some code on github towards that goal.

  6. #56
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,407
    That would have misleading information, too - it would print only one value for "RAM" :-(
    That would be not much better than that we have now?!?

  7. #57
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    The code on github right now prints this, for the LadderFilter example compiled for Teensy 4.1.

    Code:
     FLASH: code:59452, data:6152, headers:7212   free for files:8053648
      RAM1: code:65536, variables:21184   free for local variables:437568
      RAM2: variables:15520   free for malloc/new:508768

  8. #58
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,407
    Great!!

    Have to look how you did that...

  9. #59
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,407
    It prints that :
    Code:
    Der Sketch verwendet 0 Bytes (0%) des Programmspeicherplatzes. Das Maximum sind 8126464 Bytes.
    Globale Variablen verwenden 0 Bytes (0%) des dynamischen Speichers, 524288 Bytes fŁr lokale Variablen verbleiben. Das Maximum sind 524288 Bytes.
    Do I have to modify the regexs?

    I removed "-A" from the commandline.

    Or I have misunderstood "replacement" ....?? Likely!!
    So, you use a "receipe", right?

    Windows-exe:

  10. #60
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,268
    That looks really nice for used resources output!

    Not sure what 'text_csf' / headers is telling me?

  11. #61
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    Quote Originally Posted by Frank B View Post
    I removed "-A" from the commandline.
    Plan is not using builder's regex stuff.

    So add this to platform.txt

    Code:
    recipe.hooks.postbuild.4.pattern="{compiler.path}teensy_size" "{build.path}/{build.project_name}.elf"
    and delete the "upload.maximum_size" and "upload.maximum_data_size" entries for Teensy 4.x from boards.txt.

    Yes, it will print size before the library usage info. I'm ok with that.




    Quote Originally Posted by defragster View Post
    Not sure what 'text_csf' / headers is telling me?
    The first 4140 bytes are headers needed by NXP's ROM, and the last 3072 bytes are a placeholder for a digital signature and public key to someday be used when/if we support encryption & authentication.

  12. #62
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,268
    @FrankB - thanks for the EXE!

    LFSIntegrity shows this when added to TSET cmdline build - when using EXTMEM char buf[8*1024*1024] RAM LFS Media:
    Code:
     FLASH: code:86092, data:10160, headers:7212   free for files:8023000
      RAM1: code:98304, variables:21312   free for local variables:404672
      RAM2: variables:16576   free for malloc/new:507712
    EXTRAM: variables:8388608
    And without use of Extram for LFS Media of SPI:
    Code:
     FLASH: code:85916, data:10160, headers:7212   free for files:8023176
      RAM1: code:98304, variables:21312   free for local variables:404672
      RAM2: variables:16576   free for malloc/new:507712
    prior output from imxrt_size.exe::
    Code:
    RAM1:  22.81% of 512 kB used.
       Code (ITCM, 32 kB Blocks):   76.48 kB
       Variables (DTCM):            20.81 kB
       Available for Variables:    395.19 kB
    
    RAM2:   3.16% of 512 kB used.
       Variables (DMAMEM):          16.19 kB
       Available for Heap:         495.81 kB
    
    EXTMEM: not used.
    
    FLASH:   1.27% of 7936 kB used.
       Code and Constants:         100.87 kB
    And output from build system:
    Code:
    Memory region         Used Size  Region Size  %age Used
                ITCM:         96 KB       512 KB     18.75%
                DTCM:       21312 B       512 KB      4.06%
                 RAM:       16576 B       512 KB      3.16%
               FLASH:      103292 B      7936 KB      1.27%
                ERAM:          0 GB        16 MB      0.00%

  13. #63
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,268
    Quote Originally Posted by PaulStoffregen View Post
    The first 4140 bytes are headers needed by NXP's ROM, and the last 3072 bytes are a placeholder for a digital signature and public key to someday be used when/if we support encryption & authentication.
    Good to know - so that is (current) 'fixed' MCU overhead - not something user code will affect - but takes space on the FLASH.

  14. #64
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    I'm going to edit the linker scripts. Now that we can print more detailed info, having too much stuff lumped together in the .text.progmem segment means we get inaccurate info.

    If you grab newer versions of teensy_size from github, make sure you also update the core library linker scripts to match.

  15. #65
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,407
    Excellent that we have that working, now.

  16. #66
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    Minor problem... looks like arduino builder discards all the stdout printing in non-verbose mode.

  17. #67
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,268
    Quote Originally Posted by PaulStoffregen View Post
    Minor problem... looks like arduino builder discards all the stdout printing in non-verbose mode.
    Well everyone should use Verbose mode. For those using non verbose wasn't expecting this detail to be ejected. But if the normal output gets clipped then that won't show for non-verbose ... Opps

    Though making it warning output would give it cool colors to stand out

  18. #68
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    I might just patch the Java code to run it, if builder doesn't give a way to have its output seen in non-verbose mode.

  19. #69
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,407
    You can patch it to always use verbose mode!
    Btw, the build of teensy size showed a minor warning with -Wall - not important.
    Good night... zzzzzz

  20. #70
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    I changed teensy_size to print to stderr and prefix each line with "teensy_size:". This causes the size report to be visible in both verbose and non-verbose mode. But Arduino shows it in alarming red color.

    I'm going to put a small patch in the Java code to look for lines on stderr which begin with "teensy_size:" and print them in normal white text. Not the cleanest approach, but the last thing I want to do is jump into the arduino-builder & arduino-cli code.

  21. #71
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,268
    Still looks good.

    this shows here? Maybe just a local issue - but %lld fixes it.
    Code:
    teensy_size.c:54:43: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
      if (!filedata) die("unable to allocate %ld bytes\n", filesize);
                                             ~~^           ~~~~~~~~
                                             %I64d
    Prints normal white in a dos box

    Using in tset cmdline - .ld files updated:
    Code:
    teensy_size: Memory Usage on Teensy 4.1:
    teensy_size:   FLASH: code:85344, data:10904, headers:7212   free for files:8023004
    teensy_size:    RAM1: code:98304, variables:21312   free for local variables:404672
    teensy_size:    RAM2: variables:16576  free for malloc/new:507712
    teensy_size:  EXTRAM: variables:8388608

  22. #72
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    Yup, a harmless warning. Fixed on github.

    https://github.com/PaulStoffregen/te...cf8574b27bfdb5

  23. #73
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,268
    And for mtp-test - looks good?:
    Code:
    teensy_size: Memory Usage on Teensy 4.1:
    teensy_size:   FLASH: code:140560, data:13176, headers:7212   free for files:7965516
    teensy_size:    RAM1: code:163840, variables:37696   free for local variables:322752
    teensy_size:    RAM2: variables:16576  free for malloc/new:507712
    Build output:
    Code:
    Memory region         Used Size  Region Size  %age Used
                ITCM:      132812 B       512 KB     25.33%
                DTCM:       37696 B       512 KB      7.19%
                 RAM:       16576 B       512 KB      3.16%
               FLASH:      160956 B      7936 KB      1.98%

  24. #74
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,734
    Looking good, I will have to try it out.

    Wondering, In my size program I put check in for in your case free for local variables if it <=0 the program returns an error status

    don't see it in this code base. I found it helped when people for example have large tables or the like and use up all of the ram1

  25. #75
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,215
    Quote Originally Posted by KurtE View Post
    Wondering, In my size program I put check in for in your case free for local variables if it <=0 the program returns an error status

    don't see it in this code base. I found it helped when people for example have large tables or the like and use up all of the ram1
    Yes, a check for not enough RAM1 left for a reasonable size stack is a good idea. If you feel like doing this, please add it and send a pull request.

    To show an error in red text, just print to stderr without the "teensy_size: " prefix. I believe calling exit(1) should cause Arduino to terminate the build as an error, but I haven't tested.

    Here are the JAR files to put into {Arduino}/lib if you want to see the results displayed with the latest Java patches.
    Attached Files Attached Files

Posting Permissions

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