Go to advanced search

by colinh
Tue Jul 29, 2014 9:24 pm
Forum: Bare metal, Assembly language
Topic: How does raspberry pi OS work?
Replies: 80
Views: 12903

Re: How does raspberry pi OS work?

I'm guessing that's a no binary bloke that majestically deleted his answer? Well I give up on computing, but it was interesting to know how things work. I deleted his 'answer' because he had no real posts and made the account solely for the purpose of trolling you. Are you sure jran isn't trolling?...
by colinh
Tue Jul 29, 2014 3:48 pm
Forum: Graphics, sound and multimedia
Topic: Oversampling, decimation, dithering
Replies: 6
Views: 1439

Re: Oversampling, decimation, dithering

No, I meant if I sample at 4 MHz to get 40 samples to display 40 pixels (for 10 µs), if the pin happens to be switching at 4 MHz I'll be sampling at exactly the same point in the cycle and keep getting the same value, which will look like an unchanging signal.


Piscope looks very nice by the way.
by colinh
Tue Jul 29, 2014 2:48 pm
Forum: Graphics, sound and multimedia
Topic: Oversampling, decimation, dithering
Replies: 6
Views: 1439

Re: Oversampling, decimation, dithering

A logic analyser does not do any post-processing. You display each sample using the sample time as time-base. OK, but isn't there the danger then of misrepresentations? Say, in my example, a pin is switching at 4 MHz, and I'm displaying 40 pixels for 10 µs, then the display will be of a flat line, ...
by colinh
Tue Jul 29, 2014 11:21 am
Forum: Graphics, sound and multimedia
Topic: Oversampling, decimation, dithering
Replies: 6
Views: 1439

Oversampling, decimation, dithering

Hi, I'm not sure which forum this fits in best :? I'm writing a toy logic analyser / oscilloscope in assembler for my toy OS (written in assembler) [ie. no C, no libraries]. At the moment I'm just sampling the system timer (SYST_LO) register (at 44 Msamples/s) but I'll be switching to (8 pins from) ...
by colinh
Thu Jul 24, 2014 11:53 pm
Forum: Bare metal, Assembly language
Topic: DMA burst length when reading from registers
Replies: 0
Views: 719

DMA burst length when reading from registers

Hi, I'm playing with DMA transfers, including reading from the (memory mapped) registers, such as the system timer's CLO. Unfortunately, I'm on holiday, which entails limited access to a flat screen TV and miserable internet connectivity. But, worst of all, my JTAG interface seems to have broken, so...
by colinh
Wed Jul 23, 2014 10:21 pm
Forum: Bare metal, Assembly language
Topic: How does raspberry pi OS work?
Replies: 80
Views: 12903

Re: How does raspberry pi OS work?

Binaries in computers to interface with silicon. In the memory uses "switches", at least conceptually. But switches also indeed for the triggers, often in a certain part of the board. But the Rasperry Pi is triggered without switches (except for the conceptual ones in silicon). Board designers make ...
by colinh
Thu Apr 03, 2014 3:06 am
Forum: Bare metal, Assembly language
Topic: GPIO pin always low?
Replies: 4
Views: 1743

Re: GPIO pin always low?

.globl RPI_PIN_LEVEL RPI_PIN_LEVEL: ldr r0,=0x20200034 lsr r0,#16 and r0,r0,#1 bx lr This doesn't look good. You've loaded r0 with a number, divided it by 2^16 and ANDed the result with 1. If you look really carefully at the LED on/off routines, you'll see that they use r1 as well as r0. And they u...
by colinh
Tue Mar 11, 2014 1:50 am
Forum: Bare metal, Assembly language
Topic: System Timer Interrupts? (Or using interrupts at all)
Replies: 12
Views: 17623

Re: System Timer Interrupts? (Or using interrupts at all)

OK, you're trying to use The system timer, specifically System Timer Compare 1. As the first few posts in this thread note, the SoC documentation isn't very good here. In particular it doesn't bother telling you which interrupt to enable :-) In the absence of this critical bit of information, you se...
by colinh
Mon Mar 10, 2014 8:58 am
Forum: Bare metal, Assembly language
Topic: Bare Metal Examples
Replies: 33
Views: 18731

Re: Bare Metal Examples

uart77 wrote:
I must say, what you do with macros in your code is like black-magic to me
Only the most advanced programmers (ie, Tomasz) understand the complexity of my code.
:D


We less advanced programmers just make do with

ldr r0, =0x12345678
by colinh
Sun Mar 09, 2014 9:37 pm
Forum: Bare metal, Assembly language
Topic: System Timer Interrupts? (Or using interrupts at all)
Replies: 12
Views: 17623

Re: System Timer Interrupts? (Or using interrupts at all)

If you're sure that your putString is working properly, then your handler is obviously not being called. So you've shown us the wrong bit of code :-) Obviously keyboardInit must be invoked before usage, as well as kIrqHandler needs to be called from ASM interrupt handler (or to be pointed from IVT)....
by colinh
Tue Mar 04, 2014 4:24 pm
Forum: Bare metal, Assembly language
Topic: memset performance
Replies: 15
Views: 5738

Re: memset performance

init_mmu: push {lr} ldr r1, =ttbr0 // addr(TTBR0) ldr r2, =0x0000040E mov r3, #0 mov r4, #0x200 bl set_pgtbl_entry ldr r2, =0x00002416 mov r3, #0x200 mov r4, #0x1000 // end at memloc 0x01.0000.0000 (ie. 0xFFFF.FFFF) bl set_pgtbl_entry ldr r2, =0x0000040E mov r3, #0x480 // framebuffer = 0x4800.6000 ...
by colinh
Mon Mar 03, 2014 3:20 pm
Forum: Bare metal, Assembly language
Topic: memset performance
Replies: 15
Views: 5738

Re: memset performance

With regard to TTRB attributes, "device" only makes sense for memory-mapped registers, correct? In which case I don't see that being relevant to a memset function which is likely never to be used on memory-mapped registers. GPU memory might want different caching attributes to regular memory I gues...
by colinh
Sun Mar 02, 2014 10:16 pm
Forum: Bare metal, Assembly language
Topic: memset performance
Replies: 15
Views: 5738

Re: memset performance

Total: 0x0001140E OK. You probably want a different entry for the registers and IO: (ie device, not normal, memory) and you can set the XN bit for regions that don't contain executable code. That gives 0x00010416 for such memory. How's your CP15 Control Register c1? OK, you say you have I Z C and M...
by colinh
Sat Mar 01, 2014 10:27 pm
Forum: Bare metal, Assembly language
Topic: Emulation on Windows
Replies: 6
Views: 1880

Re: Emulation on Windows

Why do you want to change the values on the GPIO pins if you have no idea how to detect such changes? Anyway, you might try connecting an LED and 1k resistor in series to ground. Also, if you look at dwelch's git repository there's info on getting a bootloader installed. You can then load programs v...
by colinh
Thu Feb 27, 2014 9:25 pm
Forum: Bare metal, Assembly language
Topic: Audio
Replies: 4
Views: 1600

Re: Audio

There's a chapter on PCM/IIS Audio and one on PWM in the Broadcom SOC doc.
by colinh
Thu Feb 27, 2014 9:08 pm
Forum: Bare metal, Assembly language
Topic: Memory barriers...
Replies: 4
Views: 1946

Re: Memory barriers...

I haven't read the linked articles yet, but the way I understood the BCM doc was that if you do a load from the UART and immediately after that, a load from another peripheral, like the system timer, or gpio, then the data might arrive out of order and the register where you wanted the uart data, wi...
by colinh
Thu Feb 27, 2014 8:32 pm
Forum: Bare metal, Assembly language
Topic: memset performance
Replies: 15
Views: 5738

Re: memset performance

If you're getting 380 Mbytes/B instead of around a gigabyte/s for a memset then something is fundamentally wrong. It's hard to tell what though, without a little more info, like are you even doing this in assembler? :) You need MMU enabled. Not just I and D cache, and branch prediction bits set. I h...
by colinh
Sat Feb 22, 2014 7:41 pm
Forum: Bare metal, Assembly language
Topic: Memory barriers...
Replies: 4
Views: 1946

Memory barriers...

The BCM2835 SOC document (p.7) is actually quite clear about when and where memory barriers are required. However, it refers to "memory write barriers" and "memory read barriers". The ARM v6 ARM talks about DataMemoryBarrier (DMB) and DataSynchronizationBarrier (DSB), noting that the DSB used to be ...
by colinh
Sat Feb 22, 2014 6:19 pm
Forum: Bare metal, Assembly language
Topic: dexbasic questions
Replies: 18
Views: 4402

Re: dexbasic questions

I wrote an arm assembly program about 10 years ago simply by loading a PIC16F assembly file into an arm assembler and slowly eliminating the syntax errors. :lol: Brilliant! I tend to recommend this book a lot: ARM Assembly Language Programming by Peter Cockerell . It's long out of print, being abou...
by colinh
Sat Feb 22, 2014 6:12 pm
Forum: Bare metal, Assembly language
Topic: FIQ Size
Replies: 24
Views: 6393

Re: FIQ Size

... and it's turned off by default, as are instruction and data cacheing (see section 3.2.7 c1, Control Register of the ARM1176JZF-s TRM).
by colinh
Fri Feb 14, 2014 9:44 pm
Forum: Beginners
Topic: Creating new cd and ls function
Replies: 2
Views: 552

Re: Creating new cd and ls function

This isn't really a Raspberry Pi question, let alone a Bare Metal one. It's a Unix question... anyway, you want function cdl { cd $1; ls; } added to your .bash_profile file in your home directory. Try typing man bash . edit: if you actually *do* this, and read it all, you'll find out about command c...
by colinh
Sun Feb 09, 2014 9:21 pm
Forum: Bare metal, Assembly language
Topic: PS/2 keyboard driver in assembler
Replies: 13
Views: 5087

Re: PS/2 keyboard driver in assembler

OK, I've finally created my very own git repository

https://github.com/colin2/RPi

Oh, I have tabstops set to 4 spaces in vi - so the formatting looks off.
by colinh
Sun Feb 09, 2014 9:55 am
Forum: Bare metal, Assembly language
Topic: Useful ARM code snippet for testing multiple conditions
Replies: 0
Views: 886

Useful ARM code snippet for testing multiple conditions

You probably know the usual cmp r0, #1 cmpne r0, #2 beq somewhere // if (r0 == 1 || r0 == 2) {then ...} // and cmp r0, #10 bge somewhere cmp r0, #5 blt elsewhere here: // if (r0 >= 5 && r0 < 10) {then ...} Here's a slightly more complicated one that I've found useful (you can leave out any of the ac...
by colinh
Fri Feb 07, 2014 10:43 pm
Forum: Bare metal, Assembly language
Topic: FIQ Size
Replies: 24
Views: 6393

Re: FIQ Size

@colinh I'll look into that, but I suppose there's a greater than zero probability that the kernel might load additional stuff in the area at run time. Run time stuff wouldn't be captured in the raw image. objdump of the actual image would clear that up. Getting the uncompressed image isn't as triv...
by colinh
Fri Feb 07, 2014 10:31 pm
Forum: Bare metal, Assembly language
Topic: PS/2 keyboard driver in assembler
Replies: 13
Views: 5087

Re: PS/2 keyboard driver in assembler

I'm using one tiny Level Converter from sparkfun . It converts two inputs at 5 V to outputs at 3.3 V and two inputs at 3.3 V to outputs at 5 V too. (That's two twos, two tos and a too too :) ) I'm not using the 3.3 -> 5 V side yet (to talk to the keyboard). I have another Level Converter for the mou...

Go to advanced search