Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 12129|Reply: 6

Orange Pi Bare Metal

[Copy link]

1

Threads

3

Posts

51

Credits

Registered member

Rank: 2

Credits
51
Post time 2016-8-26 16:56:01 | Show all posts |Read mode
Hi,

Any Orange Pi Bare metal code is  available ?, minimum just to blink LED's or UART communication..
How the boot sequence works?

Regards,
Varghese ..

1

Threads

3

Posts

51

Credits

Registered member

Rank: 2

Credits
51
 Author| Post time 2016-8-29 04:41:15 | Show all posts
Update :

guys,

I did some work on this .. Now the Orange Pi bare metal code is ready ..

This is tested for Orange Pi Pc , Other boards should also work  ..

// Procedure
1. write any orange pi Linux OS to the SD Card , I have used Lubuntu_1404_For_OrangePiPC_v0_8_0_.img...  This will write the bootloader in proper place .
   ( this method is pretty simple , otherwise you have to use linux & write the bootloader in the particular partition)
2. Copy the "blink.bin" in the fat partition, same folder where  "script.bin" & "uimage" is present  (you can use any windows/linux OS )  
3. Connect USB-UART to the orange Pi , open serial putty  (use  http://www.putty.org/ or any serial application )
4. Power ON ,  now you can see boot messages in the putty screen , press any key immediately,   this will stop the control goes to linux ..
5. Now you can see "sunxi#" prompt  , enter the below command  
     fatload mmc 0 0x41000000 blink.bin; go 0x41000000
6. Now ""hello world " message appears ..

compiling  , I use gcc-arm-none-eabi-4_7-2013q3-20130916-win32.exe , on windows
just "make"

code , refer the attachment

unsigned int count=0;
int notmain ( void )
{
   
        uart_print("Hello world \n");
        while(1)
        {
                if(count)
                {
              PUT32(PIO_BASE+PA_DATA_REG, 1<<15); //pa15 red led refer schematics
                  count=0;
                }
                else
                {
                  PUT32(PIO_BASE+PA_DATA_REG, 0);
                  count=1;
                }
            uart_send(uart_recv());  // wait till it gets new char  -  echo
        }
    return(0);
}

many thanks to David Welch ,  this code is based on his bare metal code ..

I would love to add additional functionalities like , GPIO , SPI ,I2C ,Timer ,PWM , Interrupts ,Display ..

Once its added we can easily port to other Embedded OS ,  like , FreeRTOS  , Windows CE & QNX

One major good thing with this Allwinner H3 board is , it has "ehci" "ohci" USB stack , which is very easy to port  .. thats where raspberry pi fuckked up , designware OTG(raspberry uses)  has no documentation & hard to implement ..

Varghese

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

62

Threads

666

Posts

4507

Credits

Administrator

Rank: 9Rank: 9Rank: 9

Credits
4507
Post time 2016-9-3 16:48:08 | Show all posts

Hi friend, thanks for your share!

1

Threads

3

Posts

51

Credits

Registered member

Rank: 2

Credits
51
 Author| Post time 2016-9-15 19:14:17 | Show all posts
Hi Guys ,

another one awesome project , can try in the weekend

"OrangePi Ethernet Bare metal "

Resources  available
1.http://linux-sunxi.org/File:Allwinner_H3_Datasheet_V1.2.pdf      
emac registers  -page 570  , in addition we can use Linux kernel source code  " sunxi_geth.c"
2.Ethernet arduino stack example for ENC28J60  ( we need to replace 3 functions 1.Init  2.Transmit packet 3.Receive packet
3.Testing , we can use "wireshark" software
4. Base code , we can use my previous example code , that can access H3 processor registers using GET32() , PUT32() functions

After this

"Baremetal HDMI video " project  , details can be found in H3 datasheet page no 425. , yes we can use Linux Source also
Just need to access the framebuffer & draw a line ..

Varghese
rpidmx512 This user has been deleted
Post time 2018-5-16 00:47:46 | Show all posts
Note: The author has been banned or deleted.

0

Threads

4

Posts

26

Credits

Novice

Rank: 1

Credits
26
Post time 2021-2-5 04:58:31 | Show all posts
Hello!  It's great when there are forums where they can share important information.
Thank you!
For my part, I would also like to share some news with you.  Well, let's start with the fact that we have expanded our library and you can see it right on the site.  And of course most importantly, we were able to open access to our power point presentation here is the link https://www.wiseessays.com/power-point-presentation.  We decided due to the fact that this is currently the most relevant in our field, we decided to share with you new examples of essays and presentations.

0

Threads

1

Posts

8

Credits

Novice

Rank: 1

Credits
8
Post time 2021-5-10 21:42:15 | Show all posts


Great post! I am actually getting ready to across this information, is very helpful for those who is working not only with Orange Pi Bare Metal or essays on social issues
I am a worker on https://essaysbank.com/ company.
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2022-5-18 10:43 GMT+8 , Processed in 0.031669 second(s), 23 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list