tock-teensy icon indicating copy to clipboard operation
tock-teensy copied to clipboard

Porting to Teensy 3.2

Open techhazard opened this issue 7 years ago • 4 comments

Could you maybe tell me how easy it would be to port tock to the teensy 3.2 that I'm planning to use for my keyboard build.

I found two documents/datasheets for the 3.2 which you can find at the bottom of this page.

I thought that it might just be changing the ROM offsets and such, but I'm only starting with bare metal programming, so I thought I should ask someone with more experience :-)

techhazard avatar Dec 27 '17 18:12 techhazard

I've started working on porting it to the 3.2 (the teensy-3-2 branch). :smiley:

If you can find the time, could you please give me a few pointers to where the differences are? For example: I think I've entered the memory layout correctly (in boards/teensy-32/chip_layout.ld), but I'm not terribly sure :confused:

I did find some information about memory layout in section 3.5.1.2 of the K20 reference manual
( mine is the MK20DX256VLH7 ).
I used that to change the values in chip_layout.ld.

Please tell me if I am on the right track regarding memory layout and such :slightly_smiling_face:

techhazard avatar Jan 05 '18 00:01 techhazard

Hi @techhazard, this looks like an exciting project. Apologies for such a delayed response, I am currently transitioning to a new job and this repository is going to be transferred to Helena Project (helena-project). I haven't looked into detail about the specific differences between the Teensy 3.2 and 3.6 chips, although you are correct that the memory is laid out differently. I would assume that many of the basic peripherals (SPI, timers, etc.) are similar or identical to those on the 3.6. All of the Cortex-M features are the same for both chips.

One thing to be aware of is that this repository is in an awkward state at the moment, because the maintainers of Tock are currently integrating some of my (very experimental) design features into the mainline Tock repository. When this happens, it will make significant chunks of this repo obsolete (eg. the 'common' directory). There is potentially going to be some significant restructuring here, which will affect the way you proceed with your port to the 3.2.

My recommendation would be to discuss with @alevy and @daniel-scs about the road map for this repository and the 3.2 port, as they are going to be the maintainers henceforth and I'm sure they would love to include you in the conversation.

shaneleonard avatar Jan 22 '18 04:01 shaneleonard

@techhazard Note that we've now transfered this repo to the tock org (as you might notice from your browser's address bar). This doesn't neccessarily address the state of the repo as a whole, but it's a good start.

@bradjc has taken over the PR in the main repo that merges the experimental features @shaneleonard mentioned. But I don't necessarily think we need to block on that. I can take a closer look at this pull request later and soon I think we'll figure out a more stable stewardship story for this repo.

alevy avatar Jan 23 '18 02:01 alevy

@shaneleonard:

Hi @techhazard, this looks like an exciting project.

It is, though I'm taking my time :smile:.

[...] the memory is laid out differently. I would assume that many of the basic peripherals [...] are similar or identical [...]

My initial research led me to the same conclusions. The memory layout is different, but most features have a chapter in both books. I have the feeling that the memory-layout should be about the only thing that's really different. But I encountered some "magic numbers", and without proper knowledge of both devices couldn't tell which ones were only valid for the 3.6 and which ones for both. I can say that your comments about the chapters of the reference manual have helped immensely, though it would be great if you (or someone else) could help me understand those things better (this is my first "bare metal" programming endeavor).

this repository is going to be transferred to Helena Project (helena-project)

That's great to hear!

One thing to be aware of is that this repository is in an awkward state at the moment, [..] There is potentially going to be some significant restructuring here, which will affect the way you proceed with your port to the 3.2.

Thanks for this, I'll keep this in mind. Also, Xargo likely going to be merged with Cargo, which is another interesting development. So there might be breakage on all sides in the coming year. I hope that won't stop me from trying :stuck_out_tongue_winking_eye:

My recommendation would be to discuss with @alevy and @daniel-scs about the road map for this repository and the 3.2 port, as they are going to be the maintainers henceforth and I'm sure they would love to include you in the conversation.

Great Idea :slightly_smiling_face:

Apologies for such a delayed response, I am currently transitioning to a new job.

no problem, I never assumed you would reply quickly. (though I had hoped so :stuck_out_tongue_winking_eye:) And congratulations on the new job! :tada:

@alevy

Note that we've now transfered this repo to the tock org

I noticed, awesome!

[...] But I don't necessarily think we need to block on that. I can take a closer look at this pull request later and soon I think we'll figure out a more stable stewardship story for this repo.

That would be great! I started here, as previously mentioned, but comparing my changes to the 3.6 version is hard on github: all files show as new, because I copied the directory as a starting point. Comparing with 0b955ef0241fba043713599b110acddd319a8dca will work. The changes I made in that commit are in the commit message.

techhazard avatar Jan 25 '18 16:01 techhazard