How to change code flashing address in Arduino IDE for Teensy 3.6

Status
Not open for further replies.
I am using the teensy 3.6 board.
I want to flash my firmware through boot-loader codes so I flashed example boot-loader code using MCUExpresso IDE, and want to flash my firmware at address 0x0000C000, but my firmware is written in Arduino IDE and I want to change the flashing address to 0x0000C000. How can I change the flashing address in Arduino IDE for my firmware?
I am using Kinetis Flash tool for flashing my firmware through boot loader code but I am getting error "kStatusMemoryRangeInvalid", but if I tried to load sample led firmware build by MCUExpresso it's flashing without any problem.
 
? So where are the interrupt vectors, then?
Not sure if I understood your question correctly.. you don't use the Teensy-loader app?
Do you use the MKL Boooader chip? Is this a 3rd-party product?
 
Are you really using a Teensy 3.6 board?

Everything you're asking is pretty much the wrong way to go about using Teensy 3.6.
 
I am using freedom bootloader example code to flash my firmware through Kinetis flash tool. So freedom boot loader is the main code which communicates with kinetis flash tool to load user application in teensy 3.6 board, so I can load sample led code which is built by MCUExpress IDE but when I tried to load sample code which is built by Arduino IDE then I got an error in kinetis flash tool "kStatusMemoryRangeInvalid". I am trying to flash sample code at location 0xC000.
 
I am trying to bypass MKL02Z32VFG4 bootloader chip.
I want to write my boot loader code in teensy' main MCU so i can load my firmware through my boot loader code via UART protocol.
 
That seems not to be the way the Teensy 3.6 is intended to work. All Teensys come with an external bootloader chip on board which handles the upload process through USB so that no program space is wasted for bootloader code. Programming through UART is not supported.
 
You'd have to change many more things, too.. the core thinks the teensy is fresh from reset or power-on, so initialization of many things will go wrong. The program-button will start the original bootloader, a long press or just accidentally using the Teensy Loader will delete yours. You'll have 48KB Flashmemory less.
You'd have to edit the corresponding linkerscript.
 
Last edited:
I am flashing example boot loader code using teensy's loader and after that, I am using kinetis flash tool which communicates with that example bootloader code and I can successfully load sample led code.

So bypassing is not a problem, the problem is I can only flash code which is built by MCUExpresso IDE and I want to flash code which is built in Arduino IDE, kinetis flash tool required .hex file to load code teensy, so I think there are some changes required in Arduino IDE built because I am getting error of memory (kStatusMemoryRangeInvalid).

MCUExpresso's example code also require changes in linker file for target flashing address, after that, I can successfully flash the code through boot loader code, so like that, I need to change some setting in Arduino ide so can solve the error getting by kinetis flash tool.
 

Attachments

  • Untitled.png
    Untitled.png
    28.2 KB · Views: 107
What is the ultimate purpose of all this?

Because it sure sounds like your goal is to convert everything that's been developed for Teensy to some non-Teensy hardware, and ask for our help in doing so!
 
I am trying to implement OTA upgradation in Teensy via XBee module, for that, I have to write bootloader in Main MCU.

That is a contradiction with the current principle of operation inside the Teensy and Teensyduino ecosystem. People buy a Teensy instead of a bare K66 CPU to get all that Teensyduino stuff, library support, and Arduino compatibility for free. The price is that we accept as a counterpart that flashing a Teensy is exclusively done through a MKL02/04 boot loader IC which is preprogrammed with some magic sauce from PJRC. That's PJRC's business model. Schematics are free, software (source code) is free, support is free, but you go through their boot loader.

Don't expect any support for whatever will work around this principle.
 
Unfortunately, you do not tell us everything about your project, so it is difficult to give a pertinent advice.

The first question is, why is OTA needed in your project? As an old school developer, I aim towards releasing software/firmware which is well thought, elaborated, and tested in advance, so that frequent firmware updates should not be required. But perhaps you do not want to transfer firmware but application data (music, graphics, etc.) towards the Teensy without changing the firmware. In that case, solutions like external SPI flash memory, probably dual ported (read by the Teensy and written by a Wifi-enabled MCU).

But without knowing more details about what you want to achieve...
 
I have developed my firmware which is written in Arduino IDE and working at the remote location so now whenever I want to do any changes I have to go there, so that's why I want OTA upgradation for teensy.
 
Status
Not open for further replies.
Back
Top