Go to advanced search

by rst
Tue Feb 26, 2019 7:18 am
Forum: Bare metal, Assembly language
Topic: RPI3 QEMU
Replies: 51
Views: 40209

Re: RPI3 QEMU

If the qemu developers accept the patch, I'll continue with the BCM2835 System Timer. That's a bit more difficult to implement, as there's no class for it yet and it requires a dynamic memory value, but with that many bare metal projects would run under qemu (like @rst's Circle for one). Usually th...
by rst
Mon Feb 25, 2019 7:24 pm
Forum: Bare metal, Assembly language
Topic: CNTP interrupt not firing
Replies: 38
Views: 2701

Re: CNTP interrupt not firing

I think, it is not memory mapped in the BCM2836/7. You can access it via system control registers only. I've thought that too. But in DDI0487 page D10-2646 says: A Generic Timer implementation must also include a memory-mapped component. This component: - Must provide the System Counter shown in Fi...
by rst
Mon Feb 25, 2019 4:42 pm
Forum: Bare metal, Assembly language
Topic: CNTP interrupt not firing
Replies: 38
Views: 2701

Re: CNTP interrupt not firing

I did a little test and it works here this way: write32 (0x40000040, 1 << 1); u64 nCNTPCT; asm volatile ("mrs %0, CNTPCT_EL0" : "=r" (nCNTPCT)); asm volatile ("msr CNTP_CVAL_EL0 , %0" :: "r" (nCNTPCT + 19200000)); asm volatile ("msr CNTP_CTL_EL0 , %0" :: "r" (1)); Then you get an IRQ after one secon...
by rst
Mon Feb 25, 2019 3:10 pm
Forum: Bare metal, Assembly language
Topic: CNTP interrupt not firing
Replies: 38
Views: 2701

Re: CNTP interrupt not firing

LdB wrote:
Mon Feb 25, 2019 2:54 pm
You are spot on and on the figure at 3.2 Interrupt routing (page 4) it is still called the USB timer
https://www.raspberrypi.org/documentati ... rev3.4.pdf
Ah, yes. Haven't seen that. So it seems to be right.
by rst
Mon Feb 25, 2019 2:44 pm
Forum: Bare metal, Assembly language
Topic: CNTP interrupt not firing
Replies: 38
Views: 2701

Re: CNTP interrupt not firing

But it's better to have more timers than less, isn't it? Normally yes. My only problem is that they don't have a consistent name throughout the docs and the drivers, therefore it's difficult to figure out which one is which. At some point they are all called the ARM Timer, which is very confusing. ...
by rst
Mon Feb 25, 2019 7:22 am
Forum: Bare metal, Assembly language
Topic: CNTP interrupt not firing
Replies: 38
Views: 2701

Re: CNTP interrupt not firing

This works great, and polling CNTP_CTL_EL0 shows that after a second it's changed to 5 (ISTATUS=1, IMASK=0, ENABLE=1). The problem is, no matter what I do, the interrupt handler is not called, and more interestingly the ISR_EL1 register remains zero. Have you set the nCNTPNSIRQ bit in the "Core N T...
by rst
Sat Feb 23, 2019 1:15 pm
Forum: OpenGLES
Topic: Depth buffer with OpenGL ES 1.1 on Raspberry Pi 3B+
Replies: 3
Views: 2031

Depth buffer with OpenGL ES 1.1 on Raspberry Pi 3B+

I'm learning OpenGL ES at the moment and started with OpenGL ES 1.1. I programmed some rotating 3D model, derived from the hello_triangle sample in /opt/vc/src/hello_pi, which has multiple opaque colored 3D boxes (all alpha color values are 1.0f), which is basically working well, but I have a proble...
by rst
Sat Feb 16, 2019 1:21 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 193
Views: 51185

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

Mt adventures with Circle and bare metal continue. This code: const char * MakeString (const char *fmt, va_list va) { static CString sText; sText.FormatV (fmt, va); return (const char *) sText; } Such construct can only be used with C++ standard library support, which is provided using the circle-s...
by rst
Sat Feb 16, 2019 11:09 am
Forum: Bare metal, Assembly language
Topic: Segmentation fault while controlling GPIO in assembly
Replies: 7
Views: 3306

Re: Segmentation fault while controlling GPIO in assembly

But how does the code has to be changed if I want to access the ARMTimer of the Raspberry Pi, too? The code has to be changed as follows: .text .globl _start _start: ldr r0, =mem ldr r1, =0x101002 /* O_RDWR | O_SYNC */ mov r7, #5 /* open */ svc #0 mov r4, r0 /* file descriptor */ mov r0, #0 /* kern...
by rst
Fri Feb 08, 2019 6:49 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 193
Views: 51185

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

Normally Circle can be build (for AArch32) on Raspbian using the standard compiler (GNU C 6.3.0 at the moment). You have to set an empty toolchain prefix in Rules.mk (or Config.mk) to do this @rst, thank you. Simple when you know how, but I am a complete novice at bare metal on ARM and using high l...
by rst
Fri Feb 08, 2019 11:49 am
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 193
Views: 51185

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

I thought it worth recording my experience attempting to build Circle on an RPi. I am using an RPi v2 with no overclocking, and a clean install of 2018-11-13-raspbian-stretch-lite.img. Thanks for your report. I think, your problem with building Circle was caused by a compiler bug, which has already...
by rst
Wed Jan 30, 2019 10:08 am
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 193
Views: 51185

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

@cmarrin Don't understand me wrong, personally I do not have a problem with the GPL. I like the open source idea.
by rst
Tue Jan 29, 2019 5:51 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 193
Views: 51185

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

@cmarrin Thanks! I have to use the GPL, because I'm using source code from 3rd parties in Circle, which is licensed using the GPL by itself. So a license switch is not possible.
by rst
Fri Jan 04, 2019 12:24 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 193
Views: 51185

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

The 32-bit Circle project has been ported to AArch64. This includes all libraries and samples. The 32-bit support will be continued. The separate Circle64 project is discontinued. The recommended toolchains (target AArch32 and AArch64) to build Circle are based on GNU C 7.3.1 at the moment.
by rst
Sun Nov 25, 2018 10:24 am
Forum: Bare metal, Assembly language
Topic: Segmentation fault while controlling GPIO in assembly
Replies: 7
Views: 3306

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: 7
Views: 3306

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: 3645

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: 7
Views: 3306

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: 2212

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: 4693

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: 4693

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: 4693

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: 4693

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: 4693

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...

Go to advanced search