Go to advanced search

by hldswrth
Fri Oct 06, 2017 4:58 pm
Forum: Bare metal, Assembly language
Topic: [BARE-METAL][SDC/EMMC] How to access it properly??
Replies: 16
Views: 8222

Re: [BARE-METAL][SDC/EMMC] How to access it properly??

Another necro of this thread, apologies but my question is directly related to the discussion above. I would really like to understand the setting of the clock divisor and so far I've still not got it. I've tried updating my code as described here and there are some things I still don't understand o...
by hldswrth
Thu Mar 16, 2017 11:13 am
Forum: Bare metal, Assembly language
Topic: [BARE-METAL][SDC/EMMC] How to access it properly??
Replies: 16
Views: 8222

Re: [BARE-METAL][SDC/EMMC] How to access it properly??

Apologies for the late post. Just for the record the code I posted was entirely my own work and not derived from anyone else's emmc library. If there are similarities in the way the registers are accessed and divisors calculated its most likely because that was in the documentation or posted in this...
by hldswrth
Fri Jan 15, 2016 11:57 am
Forum: Bare metal, Assembly language
Topic: Performance issue
Replies: 10
Views: 2090

Re: Performance issue

You might find this thread interesting:
viewtopic.php?f=72&t=70428&p=510555&hil ... py#p510555
I was getting 1.6GB/s in the end with an optimised memset function and memory set as non-shared
by hldswrth
Tue May 05, 2015 9:21 am
Forum: Bare metal, Assembly language
Topic: Hobby OSs
Replies: 7
Views: 2108

Re: Hobby OSs

I have a hobby O/S, main goal originally was to produce something that was very quick to boot and provided full control over the RPi peripherals and was simple to use. Something like the ZX Spectrum experience :) Along the way I got a bit side-tracked with virtual memory usage and may have diverted ...
by hldswrth
Wed Mar 25, 2015 12:51 am
Forum: Bare metal, Assembly language
Topic: Loading Code Into a Memory Address?
Replies: 3
Views: 1231

Re: Loading Code Into a Memory Address?

People typically have a set of PC loading instructions with an address table, and then copy that whole lot over the low addresses for the fault vectors. Something like: # these instructions are copied over the fault vectors at their expected location. ldr pc,_reset_vector ldr pc,_undefined_vector ld...
by hldswrth
Tue Jan 27, 2015 9:33 am
Forum: Bare metal, Assembly language
Topic: Bare metal programming - downloading programs
Replies: 12
Views: 3946

Re: Bare metal programming - downloading programs

For cross-platform development I would recommend using Eclipse and Yagarto on your build computer. I use a USB to 3.3v serial adapter I got from ebay and a USB extension lead to connect the Pi to the PC. My hobby OS includes a serial port driver and SD card writer so I can download an updated O/S th...
by hldswrth
Mon Jan 12, 2015 10:15 am
Forum: Bare metal, Assembly language
Topic: MMU and multitasking
Replies: 5
Views: 1811

Re: MMU and multitasking

In my hobby OS, each task has memory allocated with only user access. Access to kernel memory only happens through software interrupts (SWI) which switch into kernel mode, then back to user mode when they finish. Each user task has its own virtual address space starting at 0, so one task cannot acce...
by hldswrth
Thu Dec 18, 2014 1:09 pm
Forum: Bare metal, Assembly language
Topic: [BARE-METAL][SDC/EMMC] How to access it properly??
Replies: 16
Views: 8222

Re: [BARE-METAL][SDC/EMMC] How to access it properly??

-> Could you please explain your gpio initialization sequence? I already saw it on other projects, and I don't understand everything (I'm speaking about your sdInitGPIO() function and the two lines marked "Check GPIO 47 status").. GPIO 47 is the SD "card detect" which tells me whether there is a car...
by hldswrth
Tue Dec 16, 2014 11:48 am
Forum: Bare metal, Assembly language
Topic: [BARE-METAL][SDC/EMMC] How to access it properly??
Replies: 16
Views: 8222

Re: [BARE-METAL][SDC/EMMC] How to access it properly??

Initialising the SD card through the EMMC interface is unfortunately not a simple process. There's a sequence of commands and responses which you need to go through to establish the card type, speed, voltage etc. before you can read and write. I've written my own SD card driver which uses the EMMC i...
by hldswrth
Sun Sep 14, 2014 8:12 pm
Forum: Bare metal, Assembly language
Topic: CSUD crashing Pi with recent firmware
Replies: 3
Views: 1250

Re: CSUD crashing Pi with recent firmware

Thanks for the pointer, I have merged the most recent source changes into my local CSUD build but the issue still persists - once I start calling KeyboardPoll in a loop, the screen goes blank a second or so later.
by hldswrth
Sun Sep 14, 2014 12:54 am
Forum: Bare metal, Assembly language
Topic: CSUD crashing Pi with recent firmware
Replies: 3
Views: 1250

CSUD crashing Pi with recent firmware

I'm curious whether anyone has the CSUD USB (Keyboard) driver working with recent firmware revisions. For me, any firmware more recent than October 2012 causes my screen to go blank not long after starting to poll the keyboard. I'd like to move to a more recent level of firmware. What's odd is that ...
by hldswrth
Tue Jul 29, 2014 8:36 am
Forum: Bare metal, Assembly language
Topic: How does raspberry pi OS work?
Replies: 80
Views: 10426

Re: How does raspberry pi OS work?

An interesting twist on the screen/memory topic - originally CRTs were used *as memory*. By controlling the beam to light spots on the screen and measuring electrical differences in the beam when going over these spots, you could store bits of information - I think originally 32x32 or 1024 bits per ...
by hldswrth
Tue Jul 01, 2014 8:36 am
Forum: Bare metal, Assembly language
Topic: Question of Compatibility for Chadderz's Simple USB Driver
Replies: 3
Views: 1610

Re: Question of Compatibility for Chadderz's Simple USB Driv

In a previous post I've reported fixes to the driver for my keyboard - one issue was that the driver retrieves an array of keys that are pressed and the number of keys pressed, and assumes that if there's one key pressed its the first in the array, which was not the case for my keyboard. The other i...
by hldswrth
Tue Jun 17, 2014 10:29 am
Forum: Bare metal, Assembly language
Topic: c libs
Replies: 7
Views: 2291

Re: c libs

The thing about bare metal is that its entirely up to you. Any C library is going to be based on a load of low-level functions that are specific to whatever bare-metal kernel they are written for (e.g. write to device, allocate memory, etc.). So a bare-metal C library is meaningless on its own. You ...
by hldswrth
Mon Jun 02, 2014 11:47 am
Forum: Bare metal, Assembly language
Topic: exception vector handling problem
Replies: 13
Views: 2948

Re: exception vector handling problem

It's not clear to me where you expect your exception vectors to be and how they get there. I guess this is done in your linker script...? The approach I take which has been suggested elsewhere in this forum is to have the vectors defined along with your main entry point and move them to low memory o...
by hldswrth
Tue May 13, 2014 1:05 pm
Forum: General discussion
Topic: Smallest OS for Raspberry Pi
Replies: 9
Views: 2810

Re: Smallest OS for Raspberry Pi

Original question didn't specify which OS, most answers assume a cut-down Linux distribution. My first response would be a question - what do you need it to do? And then how much are you prepared to do yourself? If you don't need multi-tasking, standard packages, etc. you could build something very ...
by hldswrth
Fri Apr 11, 2014 2:48 pm
Forum: Bare metal, Assembly language
Topic: CSUD question(s)...
Replies: 4
Views: 1426

Re: CSUD question(s)...

Yeah, I also posted about this here http://www.raspberrypi.org/forums/viewtopic.php?f=72&t=54965 ... with the values in the driver as written you actually end up with random memory overwrites which is pretty nasty once your bare metal os gets to any size. There is also a bug in the keyboard routine ...
by hldswrth
Tue Apr 08, 2014 12:54 pm
Forum: Bare metal, Assembly language
Topic: Bit-banging SPI for SD access?
Replies: 16
Views: 5132

Re: Bit-banging SPI for SD access?

or will the EMMC module make this impossible?
or unnecessary? Is there a specific reason why you want to bit-bang SPI? The Pi provides the EMMC registers to allow you to interact with the SD card more simply and efficiently.
by hldswrth
Tue Apr 01, 2014 11:35 am
Forum: Graphics programming
Topic: bcm2708_fb.c - DMA missing L1 cache operations?
Replies: 2
Views: 2890

Re: bcm2708_fb.c - DMA missing L1 cache operations?

I'd be interested to hear the answer here. In my bare-metal VMM experiments, I saw exactly the symptom you describe, the last part of the display not being fully updated due to the data being in the cache. My solution was to modify the memory attributes for the framebuffer memory to be write-through...
by hldswrth
Mon Mar 24, 2014 10:33 am
Forum: Bare metal, Assembly language
Topic: RPI and WIFI SD to deploy new bootcode.bin,...
Replies: 4
Views: 2217

Re: RPI and WIFI SD to deploy new bootcode.bin,...

An alternative, cheap and simple option is to use the Pi's built-in UART, and a 3.3v USB to Serial converter to establish a serial link to a PC and then have the boot loader download the kernel image via the serial link. With a wifi-enabled SD card I assume you can just copy the files to the card ov...
by hldswrth
Tue Mar 18, 2014 9:22 pm
Forum: Bare metal, Assembly language
Topic: memset performance
Replies: 15
Views: 5027

Re: memset performance

Final update here. Got non-shared memory with CSUD USB/keyboard driver working with some additional changes in the CSUD code. The simplest option was to use non-shared memory everywhere, and then force a cache clean/invalidate when transferring data from ARM to USB, which I did by updating the HcdTr...
by hldswrth
Fri Mar 14, 2014 7:28 pm
Forum: Bare metal, Assembly language
Topic: Executing programmes without OS
Replies: 2
Views: 1498

Re: Executing programmes without OS

Unless your program contains all the logic to deal with low-level interfaces on the Pi to deal with memory, I/O, etc., then your program won't run. That's what the operating system provides for you. However if you want to learn how to do all those things yourself this is the right place to come for ...
by hldswrth
Fri Mar 14, 2014 3:45 pm
Forum: Bare metal, Assembly language
Topic: memset performance
Replies: 15
Views: 5027

Re: memset performance

<edit> Managed to get this working with the values you use, with non-shared memory. I had to make some changes to my code to get it to work: 1) In the mailbox interface, because memory is shared between the ARM and VC processors, I have to clean and invalidate the data cache before writing to the ma...
by hldswrth
Thu Mar 13, 2014 12:34 pm
Forum: Bare metal, Assembly language
Topic: Checking alignment in asm
Replies: 1
Views: 946

Re: Checking alignment in asm

This is what I've ended up using. A macro that defines a label and produces an error if its not 32-byte aligned, indicating how many nop instructions are required before that label to align it: .macro ALIGNED_32 label .equ _align_\label, (. - _module_start) & 31 .if ( _align_\label == 0 ) \label: .e...
by hldswrth
Thu Mar 13, 2014 11:34 am
Forum: Bare metal, Assembly language
Topic: Checking alignment in asm
Replies: 1
Views: 946

Checking alignment in asm

In optimising my memset routine, I'd really like to insert some assembler pre-processor directives to fail the assembler in the event that a given label is not aligned on a 32-byte boundary. I have tried the following: .if (. & 31 != 0) .abort .endif This produces an error from the assembler: Error:...

Go to advanced search