View: 15643|Reply: 6

Orange Pi Bare Metal

[Copy link]

1

threads

3

posts

51

credits

Registered member

Rank: 2

credits
51
Published in 2016-8-26 16:56:01 | Show all floors |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| Published in 2016-8-29 04:41:15 | Show all floors
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 thread contains more resources

You need to Log in to download or view,No account?    Register

x

62

threads

653

posts

5498

credits

Administrator

Rank: 9Rank: 9Rank: 9

credits
5498
Published in 2016-9-3 16:48:08 | Show all floors

Hi friend, thanks for your share!

1

threads

3

posts

51

credits

Registered member

Rank: 2

credits
51
 Author| Published in 2016-9-15 19:14:17 | Show all floors
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 The user has been deleted
Published in 2018-5-16 00:47:46 | Show all floors
Tips: Disabled or deleted by author , the content is blocked

0

threads

3

posts

26

credits

Novice

Rank: 1

credits
26
Published in 2021-2-5 04:58:31 | Show all floors
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
Published in 2021-5-10 21:42:15 | Show all floors


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 need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list