Go to advanced search

by LdB
Thu Jul 02, 2020 6:29 am
Forum: C/C++
Topic: [Solved] How do I prove I am generating ARMv6 code ?
Replies: 18
Views: 637

Re: [Solved] How do I prove I am generating ARMv6 code ?

The OP is cross compiling that is only useful in the one situation you are compiling code for the Pi4 on the Pi4.

The proper cross compile commands for the Pi4 64 bit are
-mcpu=cortex-a72+crypto

Pi4 32 bit comping
-mcpu=cortex-a72 -mfloat-abi=hard -mfpu=neon-fp-armv8
by LdB
Thu Jul 02, 2020 1:52 am
Forum: C/C++
Topic: [Solved] How do I prove I am generating ARMv6 code ?
Replies: 18
Views: 637

Re: [Solved] How do I prove I am generating ARMv6 code ?

I learnt to do it for the same reasons and it is and will become more and more common on future 64bit Pi's. The same thing occurs on Intel where you have 32bit and 64bit apps running into a 64 bit O/S. However you might as well have the flags for all the old models Pi2 ARM7 32 bit -mcpu=cortex-a7 -m...
by LdB
Wed Jul 01, 2020 3:22 am
Forum: C/C++
Topic: [Solved] How do I prove I am generating ARMv6 code ?
Replies: 18
Views: 637

Re: How do I prove I am generating ARMv6 code ?

Compile library using the proper full mcu flags rather than march ... code generated is MCU specific then not generic

PI1 hard floats
-mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard
PI1 soft floats
-mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=soft
by LdB
Mon Jun 29, 2020 4:05 pm
Forum: Bare metal, Assembly language
Topic: Unexpected behavior when interfacing with GP011 (UART0)
Replies: 2
Views: 152

Re: Unexpected behavior when interfacing with GP011 (UART0)

At a guess the UART is off ... but that said I have no code that would ever bother testing that flag (see below) Does your driver actually turn it on and do all the setups on pins, clock registers etc? Also for the record you are testing the wrong bit on the transmit you are simply interested in the...
by LdB
Fri Jun 26, 2020 9:15 am
Forum: C/C++
Topic: SmartHome IoT: RPi server for website and control esp8266 wifi clients
Replies: 14
Views: 743

Re: SmartHome IoT: RPi server connect to esp8266 wifi clients

You are sort of making a mountain out of a molehill you have linux and everything at your doorstep. You have two options: 1.) "sudo apt-get install apache" and the webserver is all setup on your Pi and it will display the default page. Now your C code simply writes the webpages directly or else it w...
by LdB
Wed Jun 24, 2020 2:02 am
Forum: C/C++
Topic: spi
Replies: 7
Views: 3213

Re: spi

necro on a necro ... 8 years and counting
by LdB
Thu Jun 18, 2020 3:26 pm
Forum: Bare metal, Assembly language
Topic: Double buffering - mailbox question
Replies: 13
Views: 741

Re: Double buffering - mailbox question

The 0xC000 0000 bit is the address the VC sees. The ARM and the VC don't have the RAM in there respective address range look at page 5 on the datasheet and you will see the ARM has a much smaller address range than the VC. The VC maps the entire ARM memory in that range. https://www.raspberrypi.org/...
by LdB
Thu Jun 18, 2020 3:27 am
Forum: Bare metal, Assembly language
Topic: Double buffering - mailbox question
Replies: 13
Views: 741

Re: Double buffering - mailbox question

Sorry I didn't get a chance to answer but yes that is pretty much what I do but a FYI as an extended information and the reason for the post. For ease of use I then install a memory manager on the block I actually use heap4.c from the FreeRTOS code which I slightly modified. The reason for doing tha...
by LdB
Tue Jun 16, 2020 6:50 pm
Forum: Bare metal, Assembly language
Topic: Timer interrupts with mmu enabled
Replies: 2
Views: 266

Re: Timer interrupts with mmu enabled

I would like to see how you setup a 9 byte receive AFAIK that is going to be tricky, I think we need to see code :-) Page 175 on BCM2835-ARM-Peripherals.pdf clearly tells you the FIFO is 16 deep Separate 16x8 transmit and 16x12 receive FIFO memory Page 187 the IFLS register can only be set to b000 =...
by LdB
Mon Jun 15, 2020 4:42 pm
Forum: C/C++
Topic: Edge detection using /dev/gpiomem
Replies: 22
Views: 1055

Re: Edge detection using /dev/gpiomem

I still get the tainted kernel, I've read about this online and heater points out as well. If you have read up about it you should realize it's just a macro you are trying to set MODULE_INFO(intree, "Y"); It's supposed to set if you use the pwd of MODULES but perhaps your module build is the old ve...
by LdB
Mon Jun 15, 2020 6:39 am
Forum: C/C++
Topic: Edge detection using /dev/gpiomem
Replies: 22
Views: 1055

Re: Edge detection using /dev/gpiomem

Tainting my kernel, is there a way to avoid this? clearing I need to put the license in to the module and that would solve one but out-of-tree? If I want people to use this I can't have these sorts of things going on. The make file on that link is not correct and as you worked out the example does ...
by LdB
Mon Jun 15, 2020 2:32 am
Forum: Bare metal, Assembly language
Topic: Double buffering - mailbox question
Replies: 13
Views: 741

Re: Double buffering - mailbox question

szoshi wrote:
Sun Jun 14, 2020 1:28 pm
Now I guess i will have to read around a bit to figure out why and how.
Not much to understand when the core writes the data it just goes into it's local cache. So when you send the mailbox command to the VC4 all it sees is a pile of junk as the data written is only in the cores local cache.
by LdB
Sun Jun 14, 2020 1:06 pm
Forum: Bare metal, Assembly language
Topic: Double buffering - mailbox question
Replies: 13
Views: 741

Re: Double buffering - mailbox question

When you have the MMU on you need to do the cache operations on the mailbox message area taking it to coherency before calling .. have you done so?

If you want to cheat in the interim leave the last block in your MMU table uncached and use that for the mailbox message exchange.
by LdB
Fri Jun 12, 2020 4:39 am
Forum: C/C++
Topic: Edge detection using /dev/gpiomem
Replies: 22
Views: 1055

Re: Edge detection using /dev/gpiomem

In the end I want to release code for others and I would like it be easy to maintain, my thought is still a kernel module will need to be rebuilt every time the kernel is updated and honestly I don't know how I would automate that to keep things simple as the end user might be new. Nope what you ar...
by LdB
Thu Jun 11, 2020 5:21 pm
Forum: C/C++
Topic: Edge detection using /dev/gpiomem
Replies: 22
Views: 1055

Re: Edge detection using /dev/gpiomem

I was hoping if LdB was reading he could explain his GPIO code. The gpio code just does the setup of the physical hardware ... it does the ALT functions and register bashing. Then you have to connect the IRQ and callback handler. This is what you seem hell bent on doing .. it's called "How to avoid...
by LdB
Thu Jun 11, 2020 12:06 pm
Forum: Bare metal, Assembly language
Topic: System freezes - howto diagnose
Replies: 8
Views: 842

Re: System freezes - howto diagnose

If it's stuck in the SWI that is an immediate yield so sounds like the scheduler is jamming rather than any register corruption which will throw an exception. I will have a look tomorrow but you might want to keep an eye on each cores current task status. If there is a situation the current task is ...
by LdB
Tue Jun 09, 2020 5:21 am
Forum: Bare metal, Assembly language
Topic: Bare Metal Audio -- PCM Module Use
Replies: 2
Views: 416

Re: Bare Metal Audio -- PCM Module Use

Don't think you can send it out the audio port there is no DAC afaik (but could be wrong) you might be able to send it out via the HDMI. I imagine otherwise you just connect an audio DAC like we helped with someone connecting an I2S device a couple of posts ago https://www.raspberrypi.org/forums/vie...
by LdB
Thu Jun 04, 2020 1:07 pm
Forum: C/C++
Topic: Help with GPIO interrupts is 2020
Replies: 6
Views: 386

Re: Help with GPIO interrupts is 2020

I am no linux guru but I suspect you are getting confused with GPIO Sysfs or access via /dev/mem both of which are very dangerous. The linux documentation says nothing about it https://01.org/linuxgraphics/gfx-docs/drm/driver-api/gpio/index.html There are several warnings pertinent to what you are t...
by LdB
Thu Jun 04, 2020 12:34 pm
Forum: Bare metal, Assembly language
Topic: xRTOS - turn off MMU and still use Semaphores?
Replies: 16
Views: 1288

Re: xRTOS - turn off MMU and still use Semaphores?

No I agree that is correct .. the RTOS it comes from is running per core and not designed to do that However as per my comment if you put a signal queue on it (be it time or priority etc) it should work across cores. Anyhow I think I have coded the extension to the code based on my suggestion of usi...
by LdB
Wed Jun 03, 2020 1:13 am
Forum: Bare metal, Assembly language
Topic: xRTOS - turn off MMU and still use Semaphores?
Replies: 16
Views: 1288

Re: xRTOS - turn off MMU and still use Semaphores?

I generally ignore SteveD but just setting record straight the example already has hardware atomic semaphores using LDREX/STREX. They start at line 620 here and pretty much stock standard from the ARM primitives sheet https://github.com/LdB-ECM/Exchange/blob/master/xRTOSv2_MMU_SEMAPHORE/platform/Ras...
by LdB
Tue Jun 02, 2020 7:40 pm
Forum: C/C++
Topic: threading with pigpio
Replies: 8
Views: 538

Re: threading with pigpio

If you want to be lazy you can just grab the code I did for Eleven and his LCD You need two files from there gpio.c and gpio.h ... read the header file and it explains it. https://github.com/LdB-ECM/SSD1327_Linux_v1 If you look at main.c you should recognize a threaded example but its pretty easy ab...
by LdB
Tue Jun 02, 2020 12:58 pm
Forum: C/C++
Topic: Can anybody help me troubleshoot an "if" statement?
Replies: 45
Views: 1943

Re: Can anybody help me troubleshoot an "if" statement?

Passing a reference to a single char to string functions causes serious problems because it typically results in attempts to access addresses that are not in allocated data. That is not remotely the problem, the problem is he didn't pass a pointer and secondly the pointer must be to a null terminat...
by LdB
Tue Jun 02, 2020 9:59 am
Forum: C/C++
Topic: threading with pigpio
Replies: 8
Views: 538

Re: threading with pigpio

You just blew my mind... I did not know I could do that. haha so I take it you were using NULL :-) There is a trick we do for debugging at the start of task we have piece of code that basically just does alternate pushes of 0x5A5A5A5A and 0xA5AA5A5 to the stack depth. then resets the stack and runs...
by LdB
Tue Jun 02, 2020 6:25 am
Forum: C/C++
Topic: Help with GPIO interrupts is 2020
Replies: 6
Views: 386

Re: Help with GPIO interrupts is 2020

Set the GPIO edge interrupt up the same as you would for Baremetal enable the interrupt. You don't POLL in interrupts you install an INTERRUPT HANDLER or to be specific an interrupt bottom half handler. The interrupt setup is well covered here http://derekmolloy.ie/kernel-gpio-programming-buttons-an...
by LdB
Tue Jun 02, 2020 5:56 am
Forum: C/C++
Topic: threading with pigpio
Replies: 8
Views: 538

Re: threading with pigpio

You are not a beginner and threading so just take the GPIO directly via the linux driver gpiomem it's trivial.

Given you are threading are you sure you haven't just exceeded the default thread stack ... are you actually setting it's size ?

Go to advanced search