Go to advanced search

by JacobL
Fri Mar 27, 2015 9:02 pm
Forum: Bare metal, Assembly language
Topic: Which toolchain?
Replies: 19
Views: 7478

Re: Which toolchain?

Not sure if it is very standard, but I use crosstool-ng http://crosstool-ng.org/ to compile the toolchain for my PC targeted specifically to the RPI CPU These are instructions for creating a compiler for Linux kernels, baremetal work is very similar: http://www.bootc.net/archives/2012/05/26/how-to-b...
by JacobL
Fri Mar 06, 2015 6:08 pm
Forum: Bare metal, Assembly language
Topic: Running bare metal code on only one core?
Replies: 6
Views: 2214

Re: Running bare metal code on only one core?

Should be doable by making/finding a bootloader for this. You then let the bootloader inform linux about only the 3 spare cores and the subsection of RAM you want to allocate for linux, keeping the rest for baremetal. Note though that you cannot share devices with Linux so you need to decide where e...
by JacobL
Thu Mar 05, 2015 10:39 pm
Forum: Bare metal, Assembly language
Topic: RPi2 software reset/halt
Replies: 6
Views: 1460

Re: RPi2 software reset/halt

SW has completely crashed and may not be able to initiate a reset anymore. The SW approach could be expanded to handle this case as well. This is after all what the watchdog is meant to do, so we could just start it during normal operation. The software will then have to kick the watchdog though, w...
by JacobL
Wed Feb 25, 2015 9:36 pm
Forum: Bare metal, Assembly language
Topic: 32gears: A serial port kernel loader for RPi2
Replies: 2
Views: 819

Re: 32gears: A serial port kernel loader for RPi2

The data rate is 115200 baud, so it works well for small kernels, but it is too slow for big kernels like Linux. Does the Pi 2 serial port actually support higher rates than 115200 baud? I seem to remember that the Pi 1 has too low reference clock connected to the UART, so higher speeds would be im...
by JacobL
Mon Feb 23, 2015 3:51 pm
Forum: Bare metal, Assembly language
Topic: Register Access
Replies: 4
Views: 1176

Re: Register Access

#define GPFSEL1 0x20200004 volatile unsigned int* reg = (unsigned int*) 0; reg[GPFSEL1] |= (1 << 18); For some reason this doesn't work and I don't understand why. Can anyone help me to understand this. Thanks You define reg as a 32 bit int array. This means that the address you actually access by ...
by JacobL
Sat Feb 21, 2015 11:37 pm
Forum: Bare metal, Assembly language
Topic: BCM 2836 and the RPi 2 ?
Replies: 95
Views: 29919

Re: BCM 2836 and the RPi 2 ?

If ARM opens up then they do not make back their costs either. But the ARM part is open, at least at the programming guide level. They don't need to open up their RTL in order for it to be programmable. Anyway, if people are looking for a board with properly documented SoC, perhaps they should look...
by JacobL
Sun Feb 15, 2015 11:18 pm
Forum: Bare metal, Assembly language
Topic: System Frequency and MMU
Replies: 4
Views: 975

Re: System Frequency and MMU

The 1us system timer would probably be a convenience thing, since it translates easily to time values. Normally the timers are kept independent from the ARM core clock, since the main clock can change/stop at runtime, which also means that the frequency can be chosen for usefulness and not constrain...
by JacobL
Fri Feb 13, 2015 10:50 pm
Forum: Bare metal, Assembly language
Topic: Confused by the Device Tree (shipped with raspian)
Replies: 4
Views: 4747

Re: Confused by the Device Tree (shipped with raspian)

So then why do all 3 say peripherals are at 0x7e000000? Are the device trees on the raspian image just plain wrong? If so where do I get a correct one from? Those are the bus addresses as referenced in the BCM2835 data book. There must be another entry somewhere in the device tree that contains the...
by JacobL
Wed Jan 07, 2015 12:30 am
Forum: Bare metal, Assembly language
Topic: Bare Metal SPI
Replies: 7
Views: 3287

Re: Bare Metal SPI

I don't know the particular peripheral unfortunately, but here are some general pointers on SPI debugging: The datasheet should mention a SPI mode. There are multiple names for the same, look at http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Mode_numbers to translate between various fo...
by JacobL
Fri May 30, 2014 9:46 am
Forum: Bare metal, Assembly language
Topic: Debugging with qemu?
Replies: 3
Views: 2155

Re: Debugging with qemu?

Are you using the trick with both kernel and initrd pointing to the same image? This should be used if you want your kernel loaded at 0x8000. Otherwise the kernel will be loaded at 0x10000. Here is the script I use to start qemu with gdb, perhaps it helps: #!/bin/bash IMG="$1" [[ -f "$IMG" ]] || exi...
by JacobL
Fri May 23, 2014 3:46 am
Forum: Bare metal, Assembly language
Topic: What's the content at 0x0000?
Replies: 6
Views: 2134

Re: What's the content at 0x0000?

Simple answer is that it is a requirement from the Linux kernel on ARM for which this bootloader is normally used. The ATAGs are at 0x100 normally and the Linux kernel needs 16kB at 0x4000 for the first level MMU page table. Edit: more information about this format can be found at http://www.simtec....
by JacobL
Sat May 03, 2014 10:04 pm
Forum: Bare metal, Assembly language
Topic: Bit-banging SPI for SD access?
Replies: 16
Views: 5077

Re: Bit-banging SPI for SD access?

If I enable pull down control on GPIO50, the pin level will always be low. I do not understand why, because GPIO50 is configured as input and should read the level of DO on SD card, and not respond to changes on the pull control. Maybe the EMMC IP is somehow interfereing. Let me add to the previous...
by JacobL
Sat May 03, 2014 9:38 pm
Forum: Bare metal, Assembly language
Topic: Bit-banging SPI for SD access?
Replies: 16
Views: 5077

Re: Bit-banging SPI for SD access?

First off, what is the exact reason for bitbanging SPI here? If it falls under something like "I want to see if I can/I want to learn something/for fun/etc" then we are in the baremetal forum, and those are very good reasons here. If it is just to get access to the SD card by any possible means, the...
by JacobL
Tue Dec 03, 2013 2:42 pm
Forum: Bare metal, Assembly language
Topic: Hello World!
Replies: 9
Views: 2931

Re: Hello World!

RealProgrammer wrote:BTW Are there realtime debug toold
There is a JTAG port on the Pi. I haven't used it myself, but other people have it working. Search this forum for JTAG for more info, there should be affordable hardware available.
by JacobL
Tue Dec 03, 2013 1:47 pm
Forum: Bare metal, Assembly language
Topic: Hello World!
Replies: 9
Views: 2931

Re: Hello World!

Well, both of those use an OS The Baking Pi tutorial does not use an OS. It creates pieces for an OS from scratch and in lesson 8, they get far enough to be able to print text in the framebuffer on screen. 2 bugs in the tutorial, which consistently causes trouble for people, as firmware changed beh...
by JacobL
Mon Dec 02, 2013 3:02 pm
Forum: Bare metal, Assembly language
Topic: Hello World!
Replies: 9
Views: 2931

Re: Hello World!

Many people here have in one way or another followed the tutorial at http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/ to get started. It does in fact do just that in lesson 8. Edit: There are some code examples here: https://github.com/dwelch67/raspberrypi - though they have a slightly dif...
by JacobL
Sat Aug 17, 2013 12:30 pm
Forum: Bare metal, Assembly language
Topic: QEMU patches for RPi emulation - Initial release
Replies: 149
Views: 57331

Re: QEMU patches for RPi emulation - Initial release

Not sure if I would call it unsuccessful. For my part, it does what I need it to do. It had some bugs that blocked me in the beginning, so I fixed them and sent a patch. Not much more to it really. If you are referring to the missing support for the SETEND instruction in Qemu, then the progress is p...
by JacobL
Wed Aug 07, 2013 8:12 pm
Forum: Bare metal, Assembly language
Topic: Wrong tool for the job?
Replies: 9
Views: 2740

Re: Wrong tool for the job?

It is true that the Pi is somewhat underdocumented, so you might spend a long time researching if you want to cover all the corners. Also, if your goal is teaching programming at the low level then note that the architecture of the Pi is pretty unconventional (from an ARM programming point of view)....
by JacobL
Wed Jul 03, 2013 3:35 pm
Forum: Bare metal, Assembly language
Topic: Accessing ARMs standby-mode
Replies: 24
Views: 5730

Re: Accessing ARMs standby-mode

Missed this one: how can i find out if the pi has an external power management controller implemented? Look at the schematics and see if these signals are hardwired or goes through another chip. But since it would be an optional chip for the Pi's target audience, and the main target was low price, t...
by JacobL
Wed Jul 03, 2013 3:28 pm
Forum: Bare metal, Assembly language
Topic: Accessing ARMs standby-mode
Replies: 24
Views: 5730

Re: Accessing ARMs standby-mode

How can it do these things when the processor is in standby? It will not be in standby when it is actually doing these things. The processor will wake up, do a bit of work, then go back to sleep many times every second. So i guess that daemons use processor resources but they do it without sending ...
by JacobL
Fri Jun 28, 2013 3:51 pm
Forum: Bare metal, Assembly language
Topic: Accessing ARMs standby-mode
Replies: 24
Views: 5730

Re: Accessing ARMs standby-mode

If i'm not totally wrong that means that the OS does NOT activate the arm's standby mode when it's idle. I don't think you can necessarily conclude that yet. Try measuring the Linux current when running a program with a simple while(1); loop. This loop will be the exact equivalent to an idle loop w...
by JacobL
Thu Jun 27, 2013 3:37 pm
Forum: Bare metal, Assembly language
Topic: Accessing ARMs standby-mode
Replies: 24
Views: 5730

Re: Accessing ARMs standby-mode

first steps are done. blinker01 program by dwelch67 is running on my pi now. Current consumption is about 99mA. Under debian in idle it took about 130mA. Does this already tell me anything about the ARMs consumption or are all the parts of the pi powered although there are no drivers etc for them? ...
by JacobL
Wed Jun 26, 2013 3:35 pm
Forum: Bare metal, Assembly language
Topic: Accessing ARMs standby-mode
Replies: 24
Views: 5730

Re: Accessing ARMs standby-mode

I already did some research about that, but it was all a little hard for me to understand. It seemed to me that in the end all those pm-programs are working with that /sys/power/state file which is somewhat hard (so far impossible for me) to access... I think that is the wrong place to look, anythi...
by JacobL
Sun Jun 23, 2013 3:34 pm
Forum: Bare metal, Assembly language
Topic: Accessing ARMs standby-mode
Replies: 24
Views: 5730

Re: Accessing ARMs standby-mode

Where is that, how can i find that? Look for default_idle() in arch/arm/kernel/process.c which calls cpu_do_idle(). This maps to cpu_v6_do_idle, defined in arch/arm/mm/proc-v6.S, mapped by #define in arch/arm/include/asm/proc-fns.h Shouldn't i be able to see the ARMs standby mode from the Pi's curr...
by JacobL
Sat Jun 22, 2013 7:11 am
Forum: Bare metal, Assembly language
Topic: Virtual memory conventions
Replies: 2
Views: 920

Re: Virtual memory conventions

TTBR1 always points to a 16K page directory, allowing coverage of all 4Gb of address space on the ARM. TTBR0 is configurable (via TTBCR) to point to page directories covering smaller fractions of the address space starting at 0, so that's the one that will generally be used to point to user process...

Go to advanced search