Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
jcw's Activity
About Me
Tab Content
  • jcw's Avatar
    08-01-2021, 04:59 PM
    The link in #2 ties into the way stdio uses _write - another option is, FWIW: int printf (const char *fmt ...) { va_list ap; va_start(ap, fmt); auto r = vdprintf((int) &Serial, fmt, ap); ...
    3 replies | 518 view(s)
  • jcw's Avatar
    08-01-2021, 02:02 PM
    Yes, good catch. I tried w/ bytes() as well, same result alas. It's unfortunate (but understandable) that the HalfKay sources are not available, now it's down to guesswork on what it's expecting. The teensy_loader_cli...
    21 replies | 1132 view(s)
  • jcw's Avatar
    08-01-2021, 01:04 PM
    Yep, that's the first thing I tried: AttributeError: module 'hid' has no attribute 'Device' I'm on MacOS. I don't know how to get at version info, this is all I have: >>> hid.__file__...
    21 replies | 1132 view(s)
  • jcw's Avatar
    08-01-2021, 12:37 PM
    I'm trying to limit dependencies. The Teensy setup in PlatformIO already includes "teensy_{reboot,restart,serialmon}". There's also "teensy_loader_cli" which is fine for regular uploads, but won't handle my RAM-loading...
    21 replies | 1132 view(s)
  • jcw's Avatar
    08-01-2021, 12:07 AM
    Oh, wow, thanks for that. I've looked at the C# link, but then forgot to look a bit better at TyTools. I'm aiming for all cmd-line/scripted, i.e. just editing and (auto-) saving files, everything else automatic. My...
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-31-2021, 11:07 PM
    Yes, I'm on 1.54 - great, so state 4 should be rare. Good to know. And "teensy_loader_cli --mcu=TEENSY41 -b" will also get me from state 3 to 1. Looks like that should cover all the cases. Perfect. Update -...
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-31-2021, 10:40 PM
    To follow up ... in what I have so far, the Teensy can be in one of four states: 1. started up, and waiting for hex input 2. running the ram-application code (it'll go back to 1 if the app ends normally) 3. in...
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-31-2021, 10:02 AM
    Thanks, that explains the NOEXEC. The devil is in the detail, here's the workflow I have so far, which is already workable: * one shell window open on the flash-based core "bios" app, using cmd-line PlatformIO * one...
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-31-2021, 12:04 AM
    Ok, the basic mechanism works, but it's rather nasty: I have to reserve a generous area in ITCM as it looks like code cannot (?) execute in DTCM or in RAM2 (a bit surprising, perhaps due to a no-execute setting in the...
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-30-2021, 07:56 PM
    The Cortex-M7 is superscalar, i.e. it can process more than one instruction per clock cycle. I think that can explain it - see https://en.wikipedia.org/wiki/ARM_Cortex-M#Cortex-M7 See also...
    29 replies | 1466 view(s)
  • jcw's Avatar
    07-30-2021, 03:37 PM
    Thanks @luni, that should help a lot to streamline the process once I get the uploads going. Appreciated.
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-30-2021, 03:32 PM
    Thank you @brtaylor - that's quite a bit of reading but it looks like it will get me up to date on all the options and solutions so far. Perfect. I also suspect that the HalfKay loader is flash-only and won't let me...
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-30-2021, 01:36 PM
    To follow up, I'm not able to find the source code for "teensy_reset" and "teensy_serial" - are these online somewhere?
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-30-2021, 11:00 AM
    I'd like to reproduce a workflow on the Teensy 4 which I've been using on STM32's: place a "BIOS-like" application in flash, with a variety of libraries and drivers included, which checks for the presence of an...
    21 replies | 1132 view(s)
  • jcw's Avatar
    07-29-2021, 09:02 PM
    I've pasted the code at https://gist.github.com/jcw/73b2c29fe0172ae8938fb577035d248d That way it can be edited/fixed/tweaked without cluttering up this forum with buggy code.
    23 replies | 4379 view(s)
  • jcw's Avatar
    07-29-2021, 08:40 PM
    Yeah, my bad - I left out some important definitions. Change the definition to: extern char _itcm_block_count ;. This is nasty linker stuff. The address is the value, it's not a variable, i.e. it's not a memory...
    23 replies | 4379 view(s)
  • jcw's Avatar
    07-29-2021, 06:32 PM
    Here's some code to get to grips with memory layout and use (for the Teensy 4.1): void memInfo () { constexpr auto RAM_BASE = 0x2020'0000; constexpr auto RAM_SIZE = 512 << 10; constexpr auto...
    23 replies | 4379 view(s)
  • jcw's Avatar
    07-29-2021, 05:02 PM
    I don't know about audio, but you can find out where things live by comparing with the linker load map (tl062_t41.ld): ITCM (rwx): ORIGIN = 0x00000000, LENGTH = 512K DTCM (rwx): ORIGIN = 0x20000000, LENGTH =...
    23 replies | 4379 view(s)
  • jcw's Avatar
    07-29-2021, 12:37 PM
    At the risk of drawing out a long discussion further ... Nope, that's not exactly what's going on. The first inner while runs w times, and then always 65535 (i.e. "(uint16_t) 0 - 1"). If w were declared as uint8_t,...
    29 replies | 1466 view(s)
  • jcw's Avatar
    07-29-2021, 09:33 AM
    Careful ... on first iteration the w-loop runs N times, but on the next iterations it won't, because w is now zero.
    29 replies | 1466 view(s)
  • jcw's Avatar
    07-29-2021, 08:02 AM
    Careful ... your second loop does nothing, because buffer_ptr hasn't been reset. #include <Arduino.h> #define BUFFER_SIZE 1024 uint32_t buffer ; void setup () { while(!Serial) {}
    29 replies | 1466 view(s)
  • jcw's Avatar
    07-29-2021, 06:27 AM
    jcw replied to a thread c++17 in Technical Support & Questions
    Indeed, thanks!
    9 replies | 1701 view(s)
  • jcw's Avatar
    07-29-2021, 01:14 AM
    Found a related thread at https://forum.pjrc.com/threads/60846-T4-1-Ethernet-board?p=246596&viewfull=1#post246596
    4 replies | 409 view(s)
  • jcw's Avatar
    07-28-2021, 10:17 PM
    jcw replied to a thread c++17 in Technical Support & Questions
    Thanks, appreciated. I understand and fully respect the need to trade off "stable" vs "the latest". I have quite some code which takes advantage of C++17 language features. But hey, just askin' Update - with...
    9 replies | 1701 view(s)
  • jcw's Avatar
    07-28-2021, 09:11 PM
    jcw replied to a thread c++17 in Technical Support & Questions
    Is C++17 on the roadmap? (I noticed that Teensy 4 is still using 5.4.1)
    9 replies | 1701 view(s)
  • jcw's Avatar
    07-28-2021, 02:26 PM
    True, but that (and DC unbalance) could perhaps be solved with 0.1 F caps in series. There have been experiments with this approach, e.g. http://www.youritronics.com/magnetic-less-ethernet/. It would allow plugging a...
    4 replies | 409 view(s)
  • jcw's Avatar
    07-28-2021, 11:55 AM
    Would it be possible to connect a Teensy 4 to an Ethernet switch without the intermediate RJ45 jack + magnetics? I'm considering connecting a couple of them (each to its own switch port of course), and I would think...
    4 replies | 409 view(s)
No More Results
About jcw

Basic Information

Statistics


Total Posts
Total Posts
29
Posts Per Day
0.01
Last Post
How to make printf() to work? 08-01-2021 04:59 PM
General Information
Join Date
01-22-2013