Go to advanced search

by rst
Wed Sep 19, 2018 10:31 am
Forum: Bare metal, Assembly language
Topic: Circle Audio Buffering
Replies: 3
Views: 168

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

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

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: 19
Views: 1919

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

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

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

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

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

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...
by rst
Tue Apr 17, 2018 3:26 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 120
Views: 30759

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

Great, that it's working now. The serial bootloader can be already tested, if you checkout the develop branch. We have used Dwelch67's bootloader. Have a look into the file doc/eclipse-support.txt for infos on how to use it with Circle. It can be used with or without the Eclipse IDE. Running Lua on ...
by rst
Sun Apr 15, 2018 7:45 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 120
Views: 30759

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

You can use a resolution of 320x240, if you directly choose it in the constructor of CKernel in kernel.cpp of any sample: CKernel::CKernel (void) : m_Screen (320, 240), ... It does not work with the cmdline.txt settings, because there are some checks in CKernelOptions , which do not allow a resoluti...
by rst
Fri Apr 13, 2018 4:09 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 120
Views: 30759

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

Hi, thanks for being interested in Circle. Circle does not support accelerated graphics using the GPU. I know of the Circle-based ZX Spectrum emulator ZXBaremulator , which reaches at least 50 to 60 FPS with a PAL screen resolution, while doing sound at the same time. So for retro graphics it can be...
by rst
Wed Mar 21, 2018 9:40 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 120
Views: 30759

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

Support for the new Raspberry Pi 3 Model B+ has been added to Circle at the develop branch on GitHub including a driver for the LAN7800 Gigabit Ethernet device. I did some tests with several sample programs and everything seems to work well.
by rst
Fri Mar 02, 2018 4:41 pm
Forum: Bare metal, Assembly language
Topic: [solved] RPi-3 (aarch32) - MMU activation hangs
Replies: 23
Views: 2441

Re: RPi-3 (aarch32) - MMU activation hangs

I observed two things: You did not set the Domain Access Control Register (DACR) . This register controls the access permission for each memory domain (0-15) used in the translation table entries. Its reset value in UNKNOWN, so it is normally required to set (at least) domain 0 to "Client" (1) or "M...
by rst
Sun Dec 24, 2017 10:54 am
Forum: Bare metal, Assembly language
Topic: JustBoom DAC HAT (or any other I2S DAC HAT) on RPi 3?
Replies: 4
Views: 662

Re: JustBoom DAC HAT (or any other I2S DAC HAT) on RPi 3?

You are welcome. With I2C used for configuration it should be possible to get it running. The pHAT DAC is working with Circle. I have it here.
by rst
Sat Dec 23, 2017 1:38 pm
Forum: Bare metal, Assembly language
Topic: JustBoom DAC HAT (or any other I2S DAC HAT) on RPi 3?
Replies: 4
Views: 662

Re: JustBoom DAC HAT (or any other I2S DAC HAT) on RPi 3?

It's very likely that you have to do additional initialisations for the PCM5122 DAC chip used in this HAT. This chip has internal registers, which have to be set. The PCM5102A does not need this and the Circle driver is doing the plain I2S output only. I guess, you can only try to analyse the code o...
by rst
Thu Nov 30, 2017 11:32 am
Forum: Bare metal, Assembly language
Topic: Trying to fully understand this C++ approach the Virtual GPIO Pins of the GPU
Replies: 2
Views: 528

Re: Trying to fully understand this C++ approach the Virtual GPIO Pins of the GPU

I am a little too hung up on the assert. I am not sure why he is using a bitwise & 3 there. What is he trying to defend against? This assert ensures that the total size of the property tag structure is a multiple of 4 bytes. As I understand it, this is required by the firmware. See: https://github....
by rst
Sun Nov 19, 2017 8:58 am
Forum: Bare metal, Assembly language
Topic: Framebuffer ain't working on rpi zero :(
Replies: 7
Views: 1354

Re: Framebuffer ain't working on rpi zero :(

That's the L2 cache of the VideoCore (VC) which is enabled by default on the RPi 1 and Zero, but can be disabled in config.txt. Have a look at the diagram on page 5 of this document . There are four alias memory windows for the VC on the left side. You have to add (or to OR) 0x40000000 to each physi...
by rst
Mon Nov 13, 2017 6:41 am
Forum: Bare metal, Assembly language
Topic: Framebuffer ain't working on rpi zero :(
Replies: 7
Views: 1354

Re: Framebuffer ain't working on rpi zero :(

Do you have by any chance the data cache enabled? Then you have to mark the memory range which belongs to the frame buffer as "not cached" or you have to clean the data cache after writing to the frame buffer. This is the only idea I have at the moment.
by rst
Sun Nov 12, 2017 5:26 pm
Forum: Bare metal, Assembly language
Topic: Framebuffer ain't working on rpi zero :(
Replies: 7
Views: 1354

Re: Framebuffer ain't working on rpi zero :(

The framebufferPointer field gets populated with the value "0x4eace000", which, as I understand, is the address that I am supposed to write the pixel data to. This is a bus address. You have to AND it with 0x3FFFFFFF to get a physical address, which can be used by the ARM CPU. So here's what I am d...
by rst
Mon Nov 06, 2017 10:09 pm
Forum: Bare metal, Assembly language
Topic: Does PWM have any interrupts associated with it?
Replies: 7
Views: 995

Re: Does PWM have any interrupts associated with it?

You are welcome. I think, your explanation makes sense. I've never used a VB control, so I cannot compare this.
by rst
Mon Nov 06, 2017 8:52 pm
Forum: Bare metal, Assembly language
Topic: Does PWM have any interrupts associated with it?
Replies: 7
Views: 995

Re: Does PWM have any interrupts associated with it?

Where is m_nChunkSize defined? Here: https://github.com/rsta2/circle/blob/master/include/circle/pwmsoundbasedevice.h#L92 You can think of the variables, defined inside a C++ class declaration, being inside a C struct. In C++ each function, which is declared inside a class, gets an pointer to to thi...
by rst
Mon Nov 06, 2017 6:40 pm
Forum: Bare metal, Assembly language
Topic: Does PWM have any interrupts associated with it?
Replies: 7
Views: 995

Re: Does PWM have any interrupts associated with it?

There are several initialisations needed to get the PWM going with DMA. You may have a look at my PWM audio driver to compare, if you did the initialisations right. This driver is a little complicated, because it uses two alternating DMA buffers, but it is working well. Perhaps it helps.
by rst
Mon Nov 06, 2017 4:54 pm
Forum: Bare metal, Assembly language
Topic: Does PWM have any interrupts associated with it?
Replies: 7
Views: 995

Re: Does PWM have any interrupts associated with it?

I think, there isn't any interrupt directly associated with the PWM device. But you can use it together with a channel of the DMA controller which transfers the data into the PWM FIFO and triggers an interrupt when the transfer of a data block is completed.
by rst
Sun Oct 22, 2017 5:32 pm
Forum: Bare metal, Assembly language
Topic: My doubts in understanding baremetal
Replies: 21
Views: 3657

Re: My doubts in understanding baremetal

OK. Thanks for info! Perhaps I have to re-think this, when I have some time.

Go to advanced search