Go to advanced search

by JacobL
Fri Jun 21, 2013 4:36 pm
Forum: Bare metal, Assembly language
Topic: Accessing ARMs standby-mode
Replies: 24
Views: 5772

Re: Accessing ARMs standby-mode

If you are running Linux, you can't make it more efficient by executing a wait for interrupt instruction. The kernel will already be doing this when it's idle. The WFI instruction maps to the Linux suspend feature, and in some cases cpuidle as well. However neither of these things are supported in ...
by JacobL
Tue Jun 18, 2013 4:18 pm
Forum: Bare metal, Assembly language
Topic: Virtual memory conventions
Replies: 2
Views: 929

Virtual memory conventions

I have been reading up a bit on virtual memory, and I ran into a question. Why is is so common to map kernel memory to high addresses while keeping userspace at the low addresses? E.g. the Linux kernel 3GB/1GB split. Perhaps this comes from an x86 property? Wouldn't it be more efficient on ARM to sw...
by JacobL
Sun Jun 16, 2013 9:49 am
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57733

Re: QEMU patches for RPi emulation - Initial release

sudo apt-get install git zlib1g-dev libsdl1.2-dev libpixman-1-dev git clone git://github.com/Torlus/qemu.git -b rpi cd qemu ./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --prefix=/opt/qemu-rpi make -j[number of threads supported by PC] sudo make install Now, mount your Raspbia...
by JacobL
Wed Jun 12, 2013 3:31 pm
Forum: Bare metal, Assembly language
Topic: GPIO FIQ interrupts possible?
Replies: 16
Views: 5851

Re: GPIO FIQ interrupts possible?

I'm using Linux/C to sample gpios 0-31 at 1MHz, using DMA to pace the samples. I don't possess the means to check the accuracy. When I also drive servos at the same time I have noticed servo jitter if the network is also busy. I'd be fairly confident there is a stable solution in bare metal. http:/...
by JacobL
Mon Jun 10, 2013 3:20 pm
Forum: Bare metal, Assembly language
Topic: GPIO FIQ interrupts possible?
Replies: 16
Views: 5851

Re: GPIO FIQ interrupts possible?

Or DMA possibly ? DMA will not work at that rate. DMA operations typically take 10s of us just for starting and stopping. DMA is normally only good for one thing: letting the CPU do other stuff while large blocks of data is transferring in the background, at the price of increased latency. I'm not ...
by JacobL
Sat Jun 08, 2013 6:49 am
Forum: Bare metal, Assembly language
Topic: Interrupt latency
Replies: 6
Views: 4065

Re: Interrupt latency

The size of the routine itself will be quite small How about the rest of the code running outside the FIQ? Could it cause your FIQ handler to be evicted from cache? You could consider disabling cache and use the SRAM for your code, but it needs some careful consideration about the memory access tha...
by JacobL
Fri Jun 07, 2013 5:05 pm
Forum: Bare metal, Assembly language
Topic: Interrupt latency
Replies: 6
Views: 4065

Re: Interrupt latency

I assume that you will of course use the FIQ, and limit your code to use R8-R12 + SP + LR? I'm pretty sure the full IRQ resolver will take longer time than you have. The interrupt itself would normally occur from one clock cycle to the next (though you have to add an unknown delay due to all interru...
by JacobL
Mon Jun 03, 2013 4:01 pm
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57733

Re: QEMU patches for RPi emulation - Initial release

The code for the mem{cpy,cmp,set, move} replacements we're using are at https://github.com/bavison/arm-mem Ahh. It moved. I did wonder why most recent commit was 10 months ago. Thanks. And I can also confirm that second instruction in memcmp is a setend instruction, which is not supported in Qemu, ...
by JacobL
Sun Jun 02, 2013 1:20 pm
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57733

Re: QEMU patches for RPi emulation - Initial release

Has anyone taken a look at why we need to disable libcofi_rpi.so in 2013-02-09-wheezy-raspbian with Qemu? The code at https://github.com/simonjhall/copies-and-fills doesn't look like it has any exotic instructions, though I suppose the varied usage of conditionals might bring the Qemu instruction de...
by JacobL
Sun Jun 02, 2013 7:00 am
Forum: Bare metal, Assembly language
Topic: About Vitrual memory
Replies: 16
Views: 4096

Re: About Vitrual memory

The Linux kernel source can actually be used for reference for a way to get a mapping going that is not identity mapping. Look at arch/arm/kernel/head.S and arch/arm/kernel/head-common.S which contains the entry point for the Linux kernel on ARM. It is relatively clear code, if you can abstract from...
by JacobL
Sun Jun 02, 2013 6:24 am
Forum: Bare metal, Assembly language
Topic: Help with Realtime OS
Replies: 8
Views: 7070

Re: Help with Realtime OS

Another thing that might impact real-time performance is that the Pi does not have a vectorized interrupt controller. Compared to other systems with such a controller then IRQ latencies will be higher, which could impact real-time performance, depending on the application. It is only really a proble...
by JacobL
Sat Jun 01, 2013 5:34 am
Forum: Bare metal, Assembly language
Topic: About Vitrual memory
Replies: 16
Views: 4096

Re: About Vitrual memory

Is there a bare metal FAQ/reference somewhere? I suggest adding a link to this thread, as the last few answers pretty much sums up what you need to know to get started with virtual memory.
by JacobL
Sun May 26, 2013 4:16 pm
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57733

Re: QEMU patches for RPi emulation - Initial release

The documentation has a question regarding why the "rw" argument is necessary for booting Linux kernels. I think I can answer that: The ATAG_CORE has a read only flag, which gets set by QEMU ARM boot code, but I am pretty sure that the real rpi hardware has this cleared. This value is also set in yo...
by JacobL
Sun May 26, 2013 9:06 am
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57733

Re: QEMU patches for RPi emulation - Initial release

Your ATAGs are loaded at the wrong address. You load them at 0x400, but they should really be at 0x100 (the value in r2 at boot). Also, it would be nice to get the memory size in ATAG_MEM calculated based on memory size. Here is a patch for that: diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 8f...
by JacobL
Sun May 26, 2013 4:45 am
Forum: Bare metal, Assembly language
Topic: RPi ATAGs
Replies: 2
Views: 1086

Re: RPi ATAGs

I don't think there will be more additions to the ATAGs on Raspberry Pi. From what I can see then there is more focus on the mailbox property interface where all ATAG information is available and more. Have a look at https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface for details...
by JacobL
Sat Nov 24, 2012 2:56 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi screen01
Replies: 49
Views: 11238

Re: Baking Pi screen01

That's true, but I was going to test it that way anyway because I got it half-working without adding/subtracting any offsets. It probably wouldn't work, but I'm curious. With cache involved, there are many solutions that work on the surface some times, but doesn't work when pushed. Am I just missin...
by JacobL
Fri Nov 23, 2012 11:36 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi screen01
Replies: 49
Views: 11238

Re: Baking Pi screen01

You are not subtracting 0x40000000 from fb.buffer. Safest is probably to just clear the upper 4 bits:

Code: Select all

fb.buffer = (volatile color_rgb*)((unsigned int)fb.buffer & 0x0FFFFFFF);
by JacobL
Thu Nov 22, 2012 7:47 pm
Forum: Bare metal, Assembly language
Topic: Multiple Frame Buffers
Replies: 1
Views: 1292

Re: Multiple Frame Buffers

You could make the virtual screen double the size of the physical screen, and then just switch the offset between the two. Not sure if it works in practice, but the framebuffer API has room for virtual screens.
by JacobL
Sun Nov 18, 2012 1:57 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi screen01
Replies: 49
Views: 11238

Re: Baking Pi screen01

And, with FBI starting from 0x100000 I don't have the requirement to unplug/plug the HDMI - it just runs. Does any of that make sense with the authors? Short answer: There is a bug in the tutorial that does not account for different memory mappings between GPU and CPU. You need to add 0x40000000 to...
by JacobL
Mon Nov 12, 2012 10:45 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi screen01
Replies: 49
Views: 11238

Re: Baking Pi screen01

Perhaps the address in Archaeopteryx post should be 0xC0000000? That is the address in atags and it is the highlighted memory region in the SoC datasheet. I just tried this, and it didn't work. Perhaps the GPU L2 cache has been enabled at some point in the firmwares after the documentation was writ...
by JacobL
Sun Nov 11, 2012 1:35 am
Forum: Bare metal, Assembly language
Topic: Troubles with INCBIN
Replies: 17
Views: 3853

Re: Troubles with INCBIN

There is an undocumented bug in the tutorial, though it has come up a couple of times in the forum. Did you add 0x40000000 to the pointer you send to the GPU through the mailbox interface? And did you clear the top nibble of the framebuffer address ("and" with 0x0FFFFFFF)?
by JacobL
Sat Nov 10, 2012 8:25 pm
Forum: Bare metal, Assembly language
Topic: Small bootloader
Replies: 0
Views: 1498

Small bootloader

I just created a tiny bootloader and I thought I'd share it with the class. It is so small that it fits inside the first 0x100 bytes (252 bytes to be exact, + 48 bytes of code that handles the relocation to 0x0). It preserves the atags setup and register values, which means that it can theoretically...
by JacobL
Sat Nov 03, 2012 11:46 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi screen01
Replies: 49
Views: 11238

Re: Baking Pi screen01

Perhaps the address in Archaeopteryx post should be 0xC0000000? That is the address in atags and it is the highlighted memory region in the SoC datasheet. In any case, is there a FAQ anywhere that this golden piece of information can be stored for new people to see? It seems the tutorial itself does...
by JacobL
Sat Nov 03, 2012 10:24 pm
Forum: Bare metal, Assembly language
Topic: unable to blink status LED
Replies: 4
Views: 1754

Re: unable to blink status LED

It was removed recently. Here is the log from Git: commit c57ea9dd367f12bf4fb41b7b86806a2dc6281176 Author: popcornmix <[email protected].com> Date: Sat Oct 20 00:56:15 2012 +0100 Remove plethora of start.elf files. Now use start.elf and fixup.dat. Add config.txt paramater gpu_mem to select GPU mem an...
by JacobL
Fri Sep 07, 2012 11:05 pm
Forum: Bare metal, Assembly language
Topic: GPIO debug
Replies: 1
Views: 2436

GPIO debug

Has someone here considered using GPIO pins for debug? I mean for situations where the UART console adds too much latency, and JTAG is impractical? The idea is that you add instrumentation around code you want to track, where a specific GPIO is set high before your code, and set low again when the c...

Go to advanced search