OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:25 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Bare metal clock and timers tutorial for banana pi
PostPosted: Sun Jul 23, 2017 12:33 pm 
Offline

Joined: Mon Jul 17, 2017 10:07 pm
Posts: 6
Hello

Im trying to learn as hobby how to make baremetal programing on banana pi.

To begin I take this tutorial and made it in banana pi
http://wiki.osdev.org/ARM_RaspberryPi_Tutorial_C

Then I add the getc and made an echo shell (just show what you type in serial port);
After that i blink a led using a loop delay function;

Then i try to blink the led with interrups. I got stuck here. Im not smart enought to figure if for my self.
There is no simple information or simple code sample about clok control and timers on banana pi, and allwinner A20.
Then i try to see if i cant get the code from else here. U-boot code was my first try. But it is not simple enough get how to do it.

So.. i need some help to get this done.
Any one knows where to get a simple code sample or tutorial about clock control, timers and interrupts on banana pi / A20

Thanks


Top
 Profile  
 
 Post subject: Re: Bare metal clock and timers tutorial for banana pi
PostPosted: Sun Jul 23, 2017 2:34 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
Banana Pi is a "clone" of Raspberry Pi (sort of). None of them feature a battery powered real time clock (RTC) (low cost intended).
You can buy a separate RTC module that uses on-board GPIOs for communication and can be programmed.
If you are talking about other timers it is most likely they are using some sort of a crystal, meaning fixed frequency.
They are both acquiring their data/time information from an online server.
See if you can use PWM signaling for internal tick keeping. (most likely can be programmed, desired frequency).
Also take a look at your CPU, see if you can find any manuals online. There is a chance that there might be some timer related info.

Here is some Cortex A53 documentation (you didn't mention your processor at all):
https://developer.arm.com/products/processors/cortex-a/cortex-a53/docs

_________________
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader


Top
 Profile  
 
 Post subject: Re: Bare metal clock and timers tutorial for banana pi
PostPosted: Mon Jul 24, 2017 4:23 am 
Offline

Joined: Mon Jul 17, 2017 10:07 pm
Posts: 6
Octacone wrote:
See if you can use PWM signaling for internal tick keeping. (most likely can be programmed, desired frequency).
Also take a look at your CPU, see if you can find any manuals online. There is a chance that there might be some timer related info.


Hello. Tks.
The PWM and the manual are the path, unfortunately the manual its only a description of bytes and bits, without a single sample code.
Need to get smarter to do it.


Top
 Profile  
 
 Post subject: Re: Bare metal clock and timers tutorial for banana pi
PostPosted: Tue Jul 25, 2017 4:13 pm 
Offline
Member
Member
User avatar

Joined: Fri Feb 17, 2017 4:01 pm
Posts: 640
Location: Ukraine, Bachmut
Quote:
There is no simple information or simple code sample about clok control and timers on banana pi, and allwinner A20.

Then i try to see if i cant get the code from else here. U-boot code was my first try. But it is not simple enough get how to do it.

Any one knows where to get a simple code sample or tutorial about clock control, timers and interrupts on banana pi / A20

I fear, there is no such things as code samples on "clock control, timers and interrupts on banana pi / A20". Or it's so rare, that noone knows about its existence. Try searching for it, maybe you will be lucky to find some blog with the content which you exactly are searching for. It's just not as a common "hobby" as eg "learning to blink leds on RPi with python". You need to learn buffing your banana by yourself. :mrgreen:

But what I want to say - is don't give up on uboot inspecting. It's not as "hard" as it seems (messy but readable yet). Just have a bit of persistence. It's the ultimate source on the "bare metal programming" of such devices - all they use it as a "firmware", so nowhere else you'll find what you need.

_________________
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).


Top
 Profile  
 
 Post subject: Re: Bare metal clock and timers tutorial for banana pi
PostPosted: Wed Aug 23, 2017 6:08 am 
Offline

Joined: Mon Jul 17, 2017 10:07 pm
Posts: 6
After a lot of time reading arm manuals I manage to code a simple sample on interrupts and timers for allwinner A20 banana pi.

https://github.com/inaciose/noos/tree/master/bpi/gic02


zaval wrote:
Quote:
There is no simple information or simple code sample about clok control and timers on banana pi, and allwinner A20.

Then i try to see if i cant get the code from else here. U-boot code was my first try. But it is not simple enough get how to do it.

Any one knows where to get a simple code sample or tutorial about clock control, timers and interrupts on banana pi / A20

I fear, there is no such things as code samples on "clock control, timers and interrupts on banana pi / A20". Or it's so rare, that noone knows about its existence. Try searching for it, maybe you will be lucky to find some blog with the content which you exactly are searching for. It's just not as a common "hobby" as eg "learning to blink leds on RPi with python". You need to learn buffing your banana by yourself. :mrgreen:

But what I want to say - is don't give up on uboot inspecting. It's not as "hard" as it seems (messy but readable yet). Just have a bit of persistence. It's the ultimate source on the "bare metal programming" of such devices - all they use it as a "firmware", so nowhere else you'll find what you need.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group