Second post - Teensy Turnip! How to block incoming serial on the USB MINI port unless the program butt is pressed

The ide can send a command to the teensy at any point to upload to the device. Is there a way to block this functionality in the firmware uploaded until the button is pressed?
૮ ˶ᵔ ᵕ ᵔ˶ ა
Newbie here be gentle!
 
Perhaps you should be looking at the lockable version. Can only be re-programmed if you have the correct key (software key).
 
Perhaps you should be looking at the lockable version. Can only be re-programmed if you have the correct key (software key).
ok ill look into it. I just want the peace of mind of all usb packets not being looked into by it?? software terms idk. because a real dumb hid dev wouldn't respond or read it

thanks for your help have a wonderful day
૮ ˶ᵔ ᵕ ᵔ˶ ა
 
I mean theoretically a anti cheat would just have to spam packets to devices and it could detect any teensy if there... are vectors.
૮ ˶ᵔ ᵕ ᵔ˶ ა
 
Why?
The Arduino IDE has the ability to just compile the code or compile and program.
Bri what im concerned about is the teensy api if there is one basically being used in a way that PMO (lols) yeah if there's no way to disable it ill have to find a new hobby
thanks for your time
sorry if annoying
love you all
 
I have no idea what you mean by "PMO" and "anti cheat" and other stuff you're saying. Maybe you explained in another thread? I see you've started at least another duplicate thread. That just makes everything more confusing and harder for everyone here to help you. Please don't create duplicate threads.

The only part of this I do understand is "The ide can send a command to the teensy at any point to upload to the device. Is there a way to block this functionality in the firmware uploaded until the button is pressed?"

You can edit the code on Teensy to ignore this command. There are several ways you might do it, but the simplest is to find the _reboot_Teensyduino_() function inside usb.c. Each version of Teensy has its own USB code. For Teensy 4.x it's at line 211 in usb.c. Just delete all the code, so it becomes an empty function. When Teensy hears the command, it calls that function. If you remove all that code, the function will do nothing and Teensy will continue running. Then of course you will need to press the pushbutton if you want to actually upload new code.

Arduino IDE 2.x.x installs usb.c and all the other stuff deep inside a hidden folder. On Windows it's {AppData}. On MacOS it's ~/Library, and on Linux it's ~/.arduino15. These are hidden folders. Each OS has special ways you can get access to these hidden locations. Google search can help if you're not familiar with the way for whatever OS you use.

When you edit usb.c, I'd recommend first adding an obvious syntax error. Then click Verify in Arduino IDE. You should see a compile error with whatever wrong thing you typed. If you don't get an error, that's a sure sign you're editing the wrong file. Do this simple check first, because it's easy to waste a lot of time wondering why nothing seems to have any effect.

One gotcha is Arduino IDE will delete or overwrite this file when you later install any newer version of Teensyduino, so make a backup copy.

Hopefully this helps? If not, maybe explain a bit more about what you really need. And please don't create more duplicate threads, because it only wastes everyone's time and speads info about your needs across multiple places, which make actually helping you more difficult.
 
I have no idea what you mean by "PMO" and "anti cheat" and other stuff you're saying. Maybe you explained in another thread? I see you've started at least another duplicate thread. That just makes everything more confusing and harder for everyone here to help you. Please don't create duplicate threads.

The only part of this I do understand is "The ide can send a command to the teensy at any point to upload to the device. Is there a way to block this functionality in the firmware uploaded until the button is pressed?"

You can edit the code on Teensy to ignore this command. There are several ways you might do it, but the simplest is to find the _reboot_Teensyduino_() function inside usb.c. Each version of Teensy has its own USB code. For Teensy 4.x it's at line 211 in usb.c. Just delete all the code, so it becomes an empty function. When Teensy hears the command, it calls that function. If you remove all that code, the function will do nothing and Teensy will continue running. Then of course you will need to press the pushbutton if you want to actually upload new code.

Arduino IDE 2.x.x installs usb.c and all the other stuff deep inside a hidden folder. On Windows it's {AppData}. On MacOS it's ~/Library, and on Linux it's ~/.arduino15. These are hidden folders. Each OS has special ways you can get access to these hidden locations. Google search can help if you're not familiar with the way for whatever OS you use.

When you edit usb.c, I'd recommend first adding an obvious syntax error. Then click Verify in Arduino IDE. You should see a compile error with whatever wrong thing you typed. If you don't get an error, that's a sure sign you're editing the wrong file. Do this simple check first, because it's easy to waste a lot of time wondering why nothing seems to have any effect.

One gotcha is Arduino IDE will delete or overwrite this file when you later install any newer version of Teensyduino, so make a backup copy.

Hopefully this helps? If not, maybe explain a bit more about what you really need. And please don't create more duplicate threads, because it only wastes everyone's time and speads info about your needs across multiple places, which make actually helping you more difficult.
Thanks I appreciate it
Teensy customer happy
 
Back
Top