Go to advanced search

by JacobL
Sun Jan 03, 2016 8:20 pm
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57857

Re: QEMU patches for RPi emulation - Initial release

Thanks for pointing out. Link fixed. I had a look at that blog post. FYI, the reason for disabling libarmmem.so was explored in depth earlier in this thread. Have a look at https://www.raspberrypi.org/forums/viewtopic.php?p=362172#p362172 and the following posts. But basically QEMU does not support...
by JacobL
Sat Jan 02, 2016 12:37 am
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57857

Re: QEMU patches for RPi emulation - Initial release

pietrushnic wrote:I described my experience here.
That link doesn't work. It points to localhost, but I assume you meant to point at something on the internet.

Great info nonetheless.
by JacobL
Tue Dec 08, 2015 11:00 pm
Forum: Bare metal, Assembly language
Topic: Maximum theoretical GPIO sample speed
Replies: 6
Views: 3374

Re: Maximum theoretical GPIO sample speed

10MHz means 100ns to access a special function register (SFR) and store the result. That sounds reasonable enough, I know other bigger platforms that take longer than this. Accesses to SFR normally use restrictive access modes, which means that these accesses cannot be reordered, and the pipeline mo...
by JacobL
Fri Dec 04, 2015 8:31 pm
Forum: Bare metal, Assembly language
Topic: Weird behaviour of the "official" gcc
Replies: 22
Views: 4163

Re: Weird behaviour of the "official" gcc

The difference of error checking with different optimization levels is still odd. Should that be reported somewhere? Actually, this is pretty standard behaviour for most compilers. Many warnings/errors are generated as side effects of the analysis done for optimisations. And it runs more analysis a...
by JacobL
Wed Dec 02, 2015 7:16 pm
Forum: Bare metal, Assembly language
Topic: Initial boot environment / boot-strapping a kernel
Replies: 3
Views: 1077

Re: Initial boot environment / boot-strapping a kernel

Not sure if this is what you need, but most people here just need to know the state when their kernel has loaded. Basically the RPi bootloader is meant to boot a Linux kernel, so the environment would be the one that the Linux kernel requires. This is described here: https://www.kernel.org/doc/Docum...
by JacobL
Sat Nov 07, 2015 3:15 pm
Forum: Bare metal, Assembly language
Topic: RPi 2b (Cortex A7) instruction timing?
Replies: 17
Views: 3851

Re: RPi 2b (Cortex A7) instruction timing?

Also, it looks like a project of its own to figure out the state of RPi 2B after "Raspbian boot files". There is no documentation about what does the boot do before 'kernel7.img' starts running. There are a few things documented about the state at boot, but they come from the requirements to the bo...
by JacobL
Tue Nov 03, 2015 6:30 am
Forum: Bare metal, Assembly language
Topic: RPI2 UART example
Replies: 7
Views: 1752

Re: RPI2 UART example

I had the same issue. See viewtopic.php?f=72&t=122938
by JacobL
Tue Oct 27, 2015 8:31 pm
Forum: Bare metal, Assembly language
Topic: RPI2 UART example
Replies: 7
Views: 1752

Re: RPI2 UART example

Some simple code for outputting a character on the UART, provided it is already initialised. As far as I remember, it gets initialised by the start blob. This should output an "A" as far as I remember: #define PHYS_IO_BASE 0x3F000000 UART_PHYS_BASE .req r11 mov UART_PHYS_BASE,#PHYS_IO_BASE orr UART_...
by JacobL
Sun Oct 25, 2015 10:31 pm
Forum: Bare metal, Assembly language
Topic: Why doesn't arm-none-eabi-gcc use my custom _start symbol
Replies: 7
Views: 4411

Re: Why doesn't arm-none-eabi-gcc use my custom _start symbo

David, it looks like there is some implicit alignment of sections taking place in your example. At least, your .text starts at an address that aligns with 0x20 (32) bytes. Why the padding is seemingly weird garbage data instead of being zeroes, I don't know. Note the 32 byte cache line size on ARM, ...
by JacobL
Sun Oct 25, 2015 8:55 pm
Forum: Bare metal, Assembly language
Topic: Why doesn't arm-none-eabi-gcc use my custom _start symbol
Replies: 7
Views: 4411

Re: Why doesn't arm-none-eabi-gcc use my custom _start symbo

I think David's example illustrates well why you really want to have a separate section for _start. Because the symbol order within a section depends on the order it is specified on the command line then it is really easy to get it wrong, especially when the project grows bigger. It could be done li...
by JacobL
Sat Oct 24, 2015 7:14 pm
Forum: Bare metal, Assembly language
Topic: Why doesn't arm-none-eabi-gcc use my custom _start symbol
Replies: 7
Views: 4411

Re: Why doesn't arm-none-eabi-gcc use my custom _start symbo

The start is not defined by any specific symbol name, it is just whatever happens to be at the starting address of the platform. For Raspberry Pis, this address is normally 0x8000, which means that you will need to make sure that your startup code is linked at this address. This is normally done by ...
by JacobL
Sat Oct 24, 2015 9:59 am
Forum: Bare metal, Assembly language
Topic: How did GCC compiler know my start address is 0x8000 ?
Replies: 2
Views: 1164

Re: How did GCC compiler know my start address is 0x8000 ?

This would be where the default ARM linker script puts your code in your toolchain. This would be located at <your toolchain path>/arm-none-eabi/lib/ldscripts If you want more control, which you normally want for bare metal coding, then you should provide your own linker script through the -T parame...
by JacobL
Mon Oct 19, 2015 8:07 pm
Forum: Bare metal, Assembly language
Topic: always activate SPI?
Replies: 2
Views: 757

Re: always activate SPI?

It seems the answer depends on which Pi you are using and which header is on it. If you have the old 26 pin header, you only have SPI0 available. It doesn't look like anything interesting is muxed with SPI0, so the only downside would be that you permanently take up a couple of GPIOs if you permanen...
by JacobL
Sun Oct 11, 2015 7:18 pm
Forum: Bare metal, Assembly language
Topic: Pi 2 extra cores operation
Replies: 5
Views: 1877

Re: Pi 2 extra cores operation

Yes, that is definitely significant. Do you know if I can use kernel_old=1 and still get the ATAGS/dtb loaded? From the comments it looks like I will not be able to play with the TrustZone functionality while having the kernel read boot parameters via ATAGS/dtb in a Linux compatible manner. While Tr...
by JacobL
Sat Oct 10, 2015 10:55 pm
Forum: Bare metal, Assembly language
Topic: Pi 2 extra cores operation
Replies: 5
Views: 1877

Pi 2 extra cores operation

It was my impression that the extra cores on the Pi 2 were halted at boot, but it seems like they are really just running an endless loop. I recently ported my very simple bootloader to Pi 2, and something very curious happened. It looked like the code had been forked 4 times when I ran it, because ...
by JacobL
Sat Oct 10, 2015 9:41 pm
Forum: Bare metal, Assembly language
Topic: Seriously at my wit's end (Baking Pi)
Replies: 11
Views: 2502

Re: Seriously at my wit's end (Baking Pi)

It also sounds like you might not have set up the fs on the sd card properly. Instead of copying and pasting things I needed to download the raspbian image and then use dd to write it onto the card directly. If it's done right then there's a separate partition on the card for the boot files. Doesn'...
by JacobL
Tue Sep 15, 2015 6:27 pm
Forum: Networking and servers
Topic: Pi2 as NAT router/firewall?
Replies: 3
Views: 5674

Re: Pi2 as NAT router/firewall?

And here are the routed numbers: TCP single stream one direction: 75Mbps. TCP simultaneous up/down: about 37-38Mbps each. TCP down + 5Mbps UDP up: 71Mbps TCP down + 5Mbps UDP up. (I have 50/5 DSL, so the test is important to me) UDP single stream one direction: 97Mbps. I noticed that in this case, I...
by JacobL
Fri Sep 11, 2015 11:37 pm
Forum: Networking and servers
Topic: Pi2 as NAT router/firewall?
Replies: 3
Views: 5674

Re: Pi2 as NAT router/firewall?

Just got my Gig-E dongles, and at least part of the article matches the quick iperf test I did. I get about 170Mbps TCP Tx and about 200Mbps Rx. A simultaneous dualtest (iperf -d) gives 174Mbps Rx and 50Mbps Tx. I ran atop during the test and it showed a single core being maxed out. For Rx it showed...
by JacobL
Wed Aug 05, 2015 10:41 pm
Forum: Networking and servers
Topic: Pi2 as NAT router/firewall?
Replies: 3
Views: 5674

Pi2 as NAT router/firewall?

Just got my Pi2 and a quick iperf test shows that it saturates the 100Mbps link, something that my Pi1 cannot do. Has anyone tried adding a second USB NIC and made a NAT router from a Pi2? What kind of performance does that give? I'm considering adding 2 gigabit USB NICs, do you think that will let ...
by JacobL
Wed Jul 29, 2015 11:04 pm
Forum: Bare metal, Assembly language
Topic: Spinlocks and barriers
Replies: 1
Views: 648

Spinlocks and barriers

I'm trying to implement a spinlock on Pi 1. Spinlocks are basically just interrupt disables in uniprocessor systems, but doesn't it need an instruction barrier as well? I am using the Linux kernel as reference, and there, the sequence I can see looks like this (for spin_lock_irqsave): * Read IRQ sta...
by JacobL
Mon Jul 06, 2015 1:12 pm
Forum: Bare metal, Assembly language
Topic: C++ bare metal coding
Replies: 5
Views: 2677

Re: C++ bare metal coding

C++ requires a great deal more setup, more linker sections with specific requirements and a large runtime library, that you need to implement or integrate in a baremetal environment. My guess is that most people here just don't want to bother with all this for advantages that are pretty small at thi...
by JacobL
Mon Jul 06, 2015 12:54 pm
Forum: Bare metal, Assembly language
Topic: Bare Metal "Hello Framebuffer World"
Replies: 5
Views: 2050

Re: Bare Metal "Hello Framebuffer World"

Yes, it is definitely doable. You can follow the BakingPi tutorial linked in previous reply to a point where you actually have a basic printf() implemented. From this point, it is pretty simple to do your printf("Hello world") or whatever you want to print. BakingPi is assembly, but it is pretty sim...
by JacobL
Sun Mar 29, 2015 7:49 pm
Forum: Bare metal, Assembly language
Topic: Which toolchain?
Replies: 19
Views: 7550

Re: Which toolchain?

Or maybe someone here knows what the problem is Not sure, but you may need to add "-ffreestanding" to your compiler command line. Alternatively, this might be your problem: "arm-linux-gnueabihf". The toolchain is targeted to Linux, not baremetal, so there might be some implied code that needs to be...
by JacobL
Sat Mar 28, 2015 11:12 pm
Forum: Bare metal, Assembly language
Topic: Which toolchain?
Replies: 19
Views: 7550

Re: Which toolchain?

A quick look at "man gcc" shows that there is an option named "-mcpu=cortex-a7". Compiling with this one should give you an exact match to that CPU. Again, you might need to select this CPU name when building your toolchain with crosstool-ng. If you want a toolchain tailored specifically to this CPU...
by JacobL
Sat Mar 28, 2015 9:11 pm
Forum: Bare metal, Assembly language
Topic: Which toolchain?
Replies: 19
Views: 7550

Re: Which toolchain?

Best way to find out would probably be to compile a simple program with the exact -mcpu for your pi. For pi 1, you should run it with -mcpu=arm1176jzf-s - I am not sure of the exact one for pi 2, but someone here probably have it. Otherwise it is normally easy enough to determine from the list in th...

Go to advanced search