Go to advanced search

by rst
Sun Nov 25, 2018 10:24 am
Forum: Bare metal, Assembly language
Topic: Segmentation fault while controlling GPIO in assembly
Replies: 5
Views: 552

Re: Segmentation fault while controlling GPIO in assembly

jahboater wrote:
Sun Nov 25, 2018 9:54 am
You can do inline system calls in C with:-
...
Its much easier on x86 because you have named registers in the constraints.
Yes, but the intention here was to do it with bare assembly language. Normally one would probably do this from C by simply calling open() and mmap().
by rst
Sun Nov 25, 2018 9:48 am
Forum: Bare metal, Assembly language
Topic: Segmentation fault while controlling GPIO in assembly
Replies: 5
Views: 552

Re: Segmentation fault while controlling GPIO in assembly

I ended doing it in C because I couldn't find any documentation on system calls parameters in ARM . Because I was interested in how system calls are implemented in Linux on ARM, I figured this out now. Here is a simple assembly program, which shows how to get access to the GPIOs: .text .globl _star...
by rst
Wed Nov 21, 2018 2:55 pm
Forum: Bare metal, Assembly language
Topic: Enable Bluetooth/Wifi Rpi Zero W Bare Metal
Replies: 10
Views: 1206

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

But what i need is, for example: BT reset, send {0x01, 0x03, 0x0C, 0x00) and receive {xx, xx, xx, xx, xx, xx}... turn on BT send {xx, xx, xx, xx, xx} and receive response {xx, xx, xx, xx}.. but in linux coded, i do not see this... i see for example, HCI_RESET = 0x03, but what is 0x01 ? What is 0x0C...
by rst
Wed Nov 21, 2018 2:43 pm
Forum: Bare metal, Assembly language
Topic: Segmentation fault while controlling GPIO in assembly
Replies: 5
Views: 552

Re: Segmentation fault while controlling GPIO in assembly

I guess, your code is running on Linux, because you wouldn't get a segmentation fault otherwise. You have to map the GPIO address space into the address space of your process to be able to access it, first. There is a mmap system call, with which you can do this mapping. I have only done this using ...
by rst
Sun Nov 18, 2018 3:01 pm
Forum: Bare metal, Assembly language
Topic: Full reset?
Replies: 3
Views: 633

Re: Full reset?

See: viewtopic.php?p=413025#p413949

You have to replace the 0x20xxxxxx addresses with 0x3Fxxxxxx on the RPi 3.
by rst
Thu Nov 15, 2018 7:15 pm
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 3 Model A+ details
Replies: 23
Views: 1650

Re: Raspberry Pi 3 Model A+ details

DougieLawson wrote:
Thu Nov 15, 2018 6:45 pm
That worked, the ACT LED winked and it saw my wireless USB keyboard.
That means, the Act LED of the RPi 3A+ is on GPIO 29 like on the 3B+ and the 3A+ is widely compatible with the 3B+. USB works in host mode like on the RPi 1A+ or RPi Zero. Thank you very much for testing!
by rst
Thu Nov 15, 2018 5:34 pm
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 3 Model A+ details
Replies: 23
Views: 1650

Re: Raspberry Pi 3 Model A+ details

I have updated my code - based on the RPi 3B+ - for the 3A+ for the moment. There's no hurry. Is there anything I can run on either of my 3A+ Raspberries to test if your stuff works? Yes, you can temporarily replace the file kernel7.img on your boot partition with the attached file, after extractin...
by rst
Thu Nov 15, 2018 2:26 pm
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 3 Model A+ details
Replies: 23
Views: 1650

Re: Raspberry Pi 3 Model A+ details

No 3A+ specific section, so assume it uses the same as the 3B+? Ah yes, it's obfuscated to stop pesky users finding out about it before launch ;) Yes it's based on the 3B+ with very few mods. I suspect Phil will be along with a patch adding the 3aplus fairly soon. I have updated my code - based on ...
by rst
Thu Nov 15, 2018 11:38 am
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 3 Model A+ details
Replies: 23
Views: 1650

Re: Raspberry Pi 3 Model A+ details

Thanks for infos! For the moment I suppose, the Act LED is High-active on GPIO 29 like on the RPi 3 B+.
by rst
Thu Nov 15, 2018 10:16 am
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 3 Model A+ details
Replies: 23
Views: 1650

Raspberry Pi 3 Model A+ details

Congratulations for the new great model! I think, some developers want to support it in their software (including myself). To be able to do this, there are some questions: Which is the revision code of the new device? Where is the Act LED connected (GPIO number?) and is it Low- or High-active? Are t...
by rst
Sat Oct 13, 2018 10:30 am
Forum: Bare metal, Assembly language
Topic: FT5406 Touch coordinate corruption
Replies: 25
Views: 2400

Re: FT5406 Touch coordinate corruption

Circle is using the original algorithm for detecting touch screen events from the Linux driver. There has been an update to the Linux driver later, which fixes a spurious event issue from the touch screen. This fix has not been applied to the Circle driver yet. I will check this soon. Applying thos...
by rst
Fri Oct 12, 2018 5:00 pm
Forum: Bare metal, Assembly language
Topic: FT5406 Touch coordinate corruption
Replies: 25
Views: 2400

Re: FT5406 Touch coordinate corruption

Circle is using the original algorithm for detecting touch screen events from the Linux driver. There has been an update to the Linux driver later, which fixes a spurious event issue from the touch screen. This fix has not been applied to the Circle driver yet. I will check this soon. I did some te...
by rst
Fri Oct 12, 2018 1:38 pm
Forum: Bare metal, Assembly language
Topic: FT5406 Touch coordinate corruption
Replies: 25
Views: 2400

Re: FT5406 Touch coordinate corruption

Maybe my problem is related to yours. I'm using the Circle framework to access the touch screen, it's using this code : https://github.com/rsta2/circle/blob/master/lib/input/touchscreen.cpp I call Update() 60 times per sec as suggested, and it's working well except sometimes it misses a Touch Relea...
by rst
Thu Sep 27, 2018 11:45 am
Forum: Bare metal, Assembly language
Topic: Building a network stack
Replies: 12
Views: 946

Re: Building a network stack

I actually meant I will be ready to start working on the USB/Network stack in a month or two. I am still working on the memory system and process management, but I wanted to start reading around the subject before I am ready to start. I suspect this will take me 6 - 9 months to actually get somethi...
by rst
Wed Sep 26, 2018 7:32 pm
Forum: Bare metal, Assembly language
Topic: Building a network stack
Replies: 12
Views: 946

Re: Building a network stack

This is something I may be looking at in a month or 2 and was wondering if anyone else has done so and what pain points they had? My experience is, doing this from scratch is not that easy and it takes time, but you can learn a lot from it about USB 2.0 and TCP/IP. Do I need a working USB stack bef...
by rst
Wed Sep 26, 2018 6:40 pm
Forum: Bare metal, Assembly language
Topic: Why does my Raspberry Pi Zero W report that it has 256MB?
Replies: 7
Views: 579

Re: Why does my Raspberry Pi Zero W report that it has 256MB?

I guess, the firmware file fixup.dat is missing on your uSD card. Without it the firmware cannot relocate the file start.elf in memory.
by rst
Wed Sep 19, 2018 10:31 am
Forum: Bare metal, Assembly language
Topic: Circle Audio Buffering
Replies: 3
Views: 768

Re: Circle Audio Buffering

You are welcome. I did some measurements now and it comes out, that my guess was far too pessimistic. On a RPi 3B+ the overhead for DMA interrupt and cache management is safely below 30 microseconds per chunk. So the influence of this overhead on the available time for rendering the sound data is mi...
by rst
Tue Sep 18, 2018 10:54 am
Forum: Bare metal, Assembly language
Topic: Circle Audio Buffering
Replies: 3
Views: 768

Re: Circle Audio Buffering

Supposing you are using the PWM sound device at 44.1 KHz sample rate, writing out one sound DMA buffer with 2048 samples (1024 per channel) should take about 23 ms, as you have noted. The CPWMSoundBaseDevice class uses two of these linked sound DMA buffers, so that while one buffer is written out, t...
by rst
Sat Jun 16, 2018 3:50 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 120
Views: 32417

Re: Circle - C++ bare metal environment (with USB)

Could someone tell why are we clearing only L1 d-cache and not L1 & L2 for the multicore case, any reason? Is it specific to Raspberry Pi ? Excuse me, I'm a little late here. The reason for that behaviour of the Circle start-up code is, that the L1 caches may contain random data after reset, at lea...
by rst
Tue May 08, 2018 8:24 am
Forum: Bare metal, Assembly language
Topic: Audio output on the Raspberry Pi 3B
Replies: 26
Views: 4192

Re: Audio output on the Raspberry Pi 3B

@LdB: I guess, you have overseen that #define and the following comment: https://github.com/rsta2/circle/blob/master/lib/sysinit.cpp#L139 This for-loop is only used, if ARM_ALLOW_MULTI_CORE is not (!) defined to put the secondary cores to sleep, which was required with older firmwares, which did not...
by rst
Sun Apr 22, 2018 8:12 am
Forum: Bare metal, Assembly language
Topic: multi-core shared memory communication
Replies: 15
Views: 2602

Re: multi-core shared memory communication

Is there a way to see the stub in the fimrware by disassembling start.elf or similar? Or is the only way to write a bootloader that dumps it out? I used a program, which copies the firmware from 0x0 and writes it out to the SD card. You can also search for the firmware in the start.elf binary, if y...
by rst
Sat Apr 21, 2018 4:40 am
Forum: Bare metal, Assembly language
Topic: multi-core shared memory communication
Replies: 15
Views: 2602

Re: multi-core shared memory communication

It's working now. That's good. Yes, all cores are initially in HYP mode. I have compared the referenced armstub7.S source code with the stub which is actually loaded on my RPi 3B with a firmware from Apr 9. I'm sure, it's the same here. Setting the data cache enable bit in the control register has n...
by rst
Thu Apr 19, 2018 6:09 pm
Forum: Bare metal, Assembly language
Topic: multi-core shared memory communication
Replies: 15
Views: 2602

Re: multi-core shared memory communication

The SMP bit is already set by the ARM stub, before your code is started, here: https://github.com/raspberrypi/tools/blob/master/armstubs/armstub7.S#L69 You do not need to touch it. There is only one exception: You use the "kernel_old=1" setting in config.txt. I'm sure, you do not need to do cache ma...
by rst
Wed Apr 18, 2018 8:04 am
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 120
Views: 32417

Re: Circle - C++ bare metal environment (with USB)

Great, that it's working now!
by rst
Tue Apr 17, 2018 6:40 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 120
Views: 32417

Re: Circle - C++ bare metal environment (with USB)

I think, you already did a good job. What I can see is, that liblua.a must be moved to the first position in LIBS. There are some functions, which are not implemented yet by the circle-stdlib project. We have to find out, which functions are affected. I don't think, this is fully POSIX compatible, b...

Go to advanced search