Go to advanced search

by Chadderz
Mon Apr 06, 2015 6:41 pm
Forum: Bare metal, Assembly language
Topic: Contributions now welcome for Baking Pi
Replies: 2
Views: 779

Contributions now welcome for Baking Pi

For those who don't know me, I'm Alex Chadwick and I wrote the Baking Pi tutorials. For a long time I've been saying that I'll work on improving the tutorials, but the truth is I really don't have time. I've been kidding myself thinking I would magically get chance to work on it, on the contrary I h...
by Chadderz
Fri Jan 04, 2013 8:50 pm
Forum: Bare metal, Assembly language
Topic: Implementing a USB Driver
Replies: 86
Views: 19418

Re: Implementing a USB Driver

mark_3094 wrote:This mostly answers my question. I just wanted to be sure I could ignore anything device specific. What if something is marked as 'device only' in the core block. Can that be ignored as well?
Yes, they're safe to ignore.
by Chadderz
Fri Jan 04, 2013 11:30 am
Forum: Bare metal, Assembly language
Topic: Implementing a USB Driver
Replies: 86
Views: 19418

Re: Implementing a USB Driver

Yes, there are several banks of registers in the Synopsys SoC: core, host, device, power. The device block is completely useless on the Pi.
by Chadderz
Fri Jan 04, 2013 7:29 am
Forum: Bare metal, Assembly language
Topic: Baking Pi OK4
Replies: 4
Views: 1295

Re: Baking Pi OK4

Yes, it would take the lr we pushed, but the lr contains the address after the bl that takes us to GetTimeStamp. The bl sets the pc to the address we wish to branch to, but also has the side effect of setting lr to the address after the bl command. This means at the time of the push the lr contains ...
by Chadderz
Fri Jan 04, 2013 7:26 am
Forum: Bare metal, Assembly language
Topic: Possible Memory/Linker Issue
Replies: 3
Views: 1178

Re: Possible Memory/Linker Issue

This is almost certainly the framebufferinfo causing the problem. This was a bug in the GPU code at the time of writing the tutorial, but is now fixable. Basically, when we supply the address to the GPU via the mailbox in framebuffer.s, it sometimes doesn't flush its cache, and so the value it write...
by Chadderz
Tue Jan 01, 2013 9:24 am
Forum: Bare metal, Assembly language
Topic: Implementing a USB Driver
Replies: 86
Views: 19418

Re: Implementing a USB Driver

The lack of documentation is a barrier, but shouldn't stop you. I developed the CSUD driver by example. I accept, this is severely limiting, but it can be done with enough effort. If you have any questions, I can have a stab at answering them.
by Chadderz
Fri Dec 28, 2012 7:35 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi
Replies: 168
Views: 29753

Re: Baking Pi

As the text briefly mentions, the file main.s should be in a folder called `source'. This can also be seen from the example solutions.
by Chadderz
Fri Dec 28, 2012 10:20 am
Forum: Bare metal, Assembly language
Topic: Baking Pi and extending in C/C++
Replies: 22
Views: 3342

Re: Baking Pi and extending in C/C++

Seems I'm a bit late to the party, but for future reference here is a fairly minimal extension of the OK series to use both C and C++. I'll put it on the tutorial when I next update it.
Note that the extern "C" is only needed in C++ to stop name mangling.
by Chadderz
Sun Dec 23, 2012 3:39 pm
Forum: Bare metal, Assembly language
Topic: Baking Pi
Replies: 168
Views: 29753

Re: Baking Pi

The OK led has been relabled ACT on the new Pis being manufactured. It should affect the wiring though, it's purely a cosmetic change. Have you tried compiling and running the example solutions? That's always a good check to make sure you haven't made a mistake. Also, do you mean a litterally empty ...
by Chadderz
Sat Dec 15, 2012 12:21 am
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

Yes, unfortunately the real Synapsys datasheet for USB is confidential and tightly controlled. I did my work just based on Linux and other drivers. I know of someone who has it, advocating for the release of that particular datasheet, but I'm not sure if it'll happen. Still, I never expected the sou...
by Chadderz
Fri Dec 14, 2012 1:08 pm
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

No. the BCM data sheet doesn't mention it as it is connected to the USB.
The datasheet for the chip in question is here: http://www.smsc.com/media/Downloads_Pub ... s/9512.pdf
by Chadderz
Fri Nov 23, 2012 6:10 am
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

Great, glad you've got it. Pity we couldn't get another compiler to work, but you can't have everything in life!
by Chadderz
Thu Nov 22, 2012 9:46 pm
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

Hmm.. the enum could be causing problems, you could try replacing it with an int.
by Chadderz
Thu Nov 22, 2012 7:00 am
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

To play with the struct, simply duplicate it and alter the duplicated version. One way to test if the size was correct without going to the Pi is to include an if statement round some substantial block of code which checks it, e.g.: Result HcdInitialise() { volatile Result result; if (sizeof(struct ...
by Chadderz
Thu Nov 22, 2012 5:55 am
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

Whenever I have alignment issues, the easiest way to find them is a binary chop; delete exactly half of the data structure according to the correct size (given in the comments), and see if the extra byte is before or after what you deleted. Repeat as necessary. Just removing random bytes from the st...
by Chadderz
Wed Nov 21, 2012 8:22 pm
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

No, the PowerReg struct (probably) isn't the problem, if you look at line 588 of designware20.c it reads sizeof(struct HostGlobalRegs), sizeof(struct CoreGlobalRegs)); but should read sizeof(struct HostGlobalRegs), sizeof(struct CoreGlobalRegs), sizeof(struct PowerReg)); The problem is the CoreGloba...
by Chadderz
Wed Nov 21, 2012 6:01 am
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

Shouldn't be, bool is defined in types.h so it becomes valid in the rest of the code.
by Chadderz
Tue Nov 20, 2012 10:03 pm
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 56
Views: 17708

Re: CSUD - Chadderz's Simple USB Driver (Source)

Hi, Yes indeed looks to be the struct sizes (also have I messed up a format there, 0x7ffff14 seems a tad excessive!). I only ever complied it using the toolchain in the tutorials under Windows, but things like struct packing and size are compiler specific, so that's the issue. If you figure out what...
by Chadderz
Sat Oct 13, 2012 6:49 am
Forum: Bare metal, Assembly language
Topic: Baking Pi
Replies: 168
Views: 29753

Re: Baking Pi

Could it be that the build directory doesn't exist?
by Chadderz
Thu Oct 11, 2012 7:43 am
Forum: Bare metal, Assembly language
Topic: Baking Pi
Replies: 168
Views: 29753

Re: Baking Pi

Looks like you don't have libcsud.a which should be in the same directory as the makefile. This is my mistake; it should be in the archive of example01. libcsud.a is the USB driver used to get keyboard input. If you don't have it, you can find it in the 'Template for USB Operating System' on the dow...
by Chadderz
Wed Oct 10, 2012 8:30 pm
Forum: Bare metal, Assembly language
Topic: Linker script
Replies: 1
Views: 1706

Re: Linker script

Hi badut Sorry for the very slow reply. The 0x3F3F3F3F commands tell the linker to pad with 0x3F instead of 0 as it normally does. This is totally unnecessary, though harmless. I added it so that I could view back the memory, and know which bits had been set to 0, and which ones were still 0 by defa...
by Chadderz
Mon Sep 17, 2012 8:41 pm
Forum: Bare metal, Assembly language
Topic: Troubles with INCBIN
Replies: 17
Views: 3746

Re: Troubles with INCBIN

Good stuff. Perhaps I should move the frameBufferInfo to its own section too.

Could you have put a .align and the label the wrong way round? I made that mstake a few times; it causes you to miss the start. The .align must come first, otherwise the label addresses the address before alignment.
by Chadderz
Mon Sep 17, 2012 3:09 pm
Forum: Bare metal, Assembly language
Topic: Stuck at OK01...
Replies: 14
Views: 4757

Re: Stuck at OK01...

I'm Alex, I wrote the tutorial. I'm always on the look out for improvements, both here and by email, especially to troubleshooting. I know from experience it's one of the hardest, and often one of the least well documented areas of tutorials, especially ones as obscure as this. I definitely need to ...
by Chadderz
Sun Sep 16, 2012 8:17 pm
Forum: Bare metal, Assembly language
Topic: Troubles with INCBIN
Replies: 17
Views: 3746

Re: Troubles with INCBIN

One thing that jumped out in the bob.s file is that you have a push not a pop at the bottom! That may not be the issue however. I suspect it may be the dreaded HDMI problems caused be alignment of frameBufferInfo. As can be seen in other forum posts, adding new code can sometimes move the location o...
by Chadderz
Sun Sep 16, 2012 4:09 pm
Forum: Bare metal, Assembly language
Topic: Baking pi Input01
Replies: 11
Views: 2469

Re: Baking pi Input01

Oh, I've not seen that before. I'll have to see if thats an issue with more keyboards. Thanks for letting me know and well done for figuring it out.

Go to advanced search