Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Starting into bare-metal drivers using a Teensy 4.0

Status
Not open for further replies.

Lockna

New Member
Hey!
So I want to start writing some bare-metal using my Teensy 4.0 development board.
I want to write them in Rust, to improve myself.

So, I guess, one of the first things I have to do, is to get a serial connection to the pc. So I can send data from and to the uC. Where should I start with this?
I have found the datasheet for the cpu and I'm reading in it
But, since there are multiple serial ports I don't know which one to choose. Should I use a hardware one, or should I go for the on in USB? (UART)

Are there any other things I should think of? do you know some good resources, to get into it?
I mean I probably have to read to understand mmio, usb, serial, uart etc.

Best regards
 
Well yes, but that is not my intention

So why even ask here? - you want to write code using an obscure and fairly unknown language, with little support - you're unlikely to find members here who have ever used it, or have any plans to.

If you want help with an obscure language you need to find a forum that specifically supports it.
 
I have played with the Teensy 3.6 and found the Arduino IDE an exceptional tool.. I gather from your response to Mike you want to write your own drivers.. Good luck with that, But even downloading the Arduino tools, all the details can be ripped direct from their code...

BUT!! as it worked so well I just used it...
 
Doesn't writing drivers need an operating system which kinda isn't bare metal!! Or are your drivers somehow different? I've written code on lots of different micros and never needed to write or obtain a driver.

Mike.
 
No, not bare metal drivers.
See, I write a Serial Driver, so the user can send a message via Serial.write or Serial.println whatever
So, the User don't have to interact with the hardware himself
 
We seem to have different ideas about what a driver is. To me, a driver allows an operating system to interact with hardware and a library is just convenient code you can include in your code. Not to worry, it's just semantics.

Mike.
 
We seem to have different ideas about what a driver is. To me, a driver allows an operating system to interact with hardware and a library is just convenient code you can include in your code. Not to worry, it's just semantics.

Mike.

Yes, I think he's got a wildly different idea of what a 'driver' might be? :D

However, it should basically be part of his programming system - and all he should need to write is something like the standard:

C:
char getch(void)
{
    return EUSART1_Read();
}

void putch(char txData)
{
    EUSART1_Write(txData);
}
 
I want to write them in Rust, to improve myself.

I thought This was going to be a setup where he was waiting for someone to ask what the hell "Rust" is so he can go into shill-mode and and encourage all of us to get a copy and write our own "bare metal" code. So far, I'm wrong. But I'm patient.
 
I thought This was going to be a setup where he was waiting for someone to ask what the hell "Rust" is so he can go into shill-mode and and encourage all of us to get a copy and write our own "bare metal" code. So far, I'm wrong. But I'm patient.
I tried once, but I used stainless steel so the code would never compile..
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top