Go to advanced search

by LdB
Mon Jun 17, 2019 12:30 pm
Forum: Bare metal, Assembly language
Topic: Unexpected behaviour of arrays and switch statements
Replies: 10
Views: 361

Re: Unexpected behaviour of arrays and switch statements

That should work, I cant see any problem. I guess it has to be a weird compiler bug have you checked for updates? You could try the other three ways to write the array static const int cols[7] = { 0xFFFF0000, 0xFFFF7F00, 0xFFFFFF00, 0xFF00FF00, 0xFF0000FF, 0xFF4B0082, 0xFF9400D3 }; static int cols[]...
by LdB
Mon Jun 17, 2019 6:45 am
Forum: Bare metal, Assembly language
Topic: Unexpected behaviour of arrays and switch statements
Replies: 10
Views: 361

Re: Unexpected behaviour of arrays and switch statements

I suspect we need to see your linker file and the function drawNum because it is obviously having issues with constant arrays.
by LdB
Sun Jun 16, 2019 3:27 pm
Forum: Bare metal, Assembly language
Topic: Unexpected behaviour of arrays and switch statements
Replies: 10
Views: 361

Re: Unexpected behaviour of arrays and switch statements

Most likely your linker file isn't saving the rodata section which is the one the constant data will go into, so basically your file doesn't actually contain the constant array and is printing junk. Without changing the linker file try putting the array in the text section ... something like int __a...
by LdB
Sat Jun 15, 2019 3:14 am
Forum: Bare metal, Assembly language
Topic: A little Progress on my little OS Project:
Replies: 23
Views: 1250

Re: A little Progress on my little OS Project:

The animation is slightly fudged ... if you actually did the real algorithm visually it would not work for us humans :-) It might still have those small glitches, I cant say you can see any on screen. It's not traditional scan lining in doing each y line in turn but the real thing does an exact norm...
by LdB
Fri Jun 14, 2019 3:21 pm
Forum: Bare metal, Assembly language
Topic: A little Progress on my little OS Project:
Replies: 23
Views: 1250

Re: A little Progress on my little OS Project:

Been thru all that and things like paint floodfills the scanline method is 100 times faster than any of the options as actually measured on the PI because the VC4 is so dam good at it. Basically it's quicker at doing the manual solve of the equations than actually testing each point and along with t...
by LdB
Thu Jun 13, 2019 5:07 pm
Forum: Bare metal, Assembly language
Topic: A little Progress on my little OS Project:
Replies: 23
Views: 1250

Re: A little Progress on my little OS Project:

Cheers I like that a lot let me do some testing. If you are into you maths I have another one for you to have a crack at :-) As you know what you really want to do is fill the outline glyph not draw it. The fastest way to do that is to run a scanline on the y integer values from the top of the scale...
by LdB
Thu Jun 13, 2019 5:09 am
Forum: Bare metal, Assembly language
Topic: Changing TTBR1_EL1 while memory caching enabled?
Replies: 5
Views: 219

Re: Changing TTBR1_EL1 while memory caching enabled?

That is a hideously big virtualization space for the little PI ... 2^48 :-)

I am not sure whether to be impressed or scared with what you are doing.
by LdB
Wed Jun 12, 2019 2:13 am
Forum: Bare metal, Assembly language
Topic: Changing TTBR1_EL1 while memory caching enabled?
Replies: 5
Views: 219

Re: Changing TTBR1_EL1 while memory caching enabled?

I agree with what you are saying ... it has to be cache issue. However what you are doing is slightly strange usually you just add and delete blocks from the virtual table because you have a live kernel running in the virtual memory. I don't think I have ever reset TTBR1_EL1 from anything but the in...
by LdB
Wed Jun 12, 2019 1:19 am
Forum: Bare metal, Assembly language
Topic: Changing TTBR1_EL1 while memory caching enabled?
Replies: 5
Views: 219

Re: Changing TTBR1_EL1 while memory caching enabled?

After setting all it really should just need is an "isb". As for table the TTBR1_EL1 is the easy one because usually you have the 1:1 mapping on TTBR0_EL1 so you can just initially use a top level table all zeroed and try bringing it online. You don't actually need a table in the virtual space at al...
by LdB
Tue Jun 04, 2019 11:54 am
Forum: C/C++
Topic: "Segmentation fault" error while using bcm2835 librarry
Replies: 3
Views: 156

Re: "Segmentation fault" error while using bcm2835 librarry

At a guess you are running under linux and haven't mapped access to the SPI registers.

There is probably an Init call somewhere you are supposed to make before doing anything with the library, so did you read the instructions?.
by LdB
Tue Jun 04, 2019 11:52 am
Forum: C/C++
Topic: C compiling in AArch64 only use Thumb-2?
Replies: 12
Views: 345

Re: C compiling in AArch64 only use Thumb-2?

I think I added to the confusion because I misunderstood what you were asking ... so lets call it combined effort :-)
by LdB
Tue Jun 04, 2019 1:39 am
Forum: C/C++
Topic: C compiling in AArch64 only use Thumb-2?
Replies: 12
Views: 345

Re: C compiling in AArch64 only use Thumb-2?

You can't just compile like that in short form when doing cross compiling :-) You are on a PC (Intel Processor) and you are crossing to an ARM processor or Vice Versa. To go from PC to ARM you also need the arm libraries, to go from ARM to PC you need the Intel libraries. Read http://jensd.be/800/li...
by LdB
Mon Jun 03, 2019 3:53 pm
Forum: C/C++
Topic: C compiling in AArch64 only use Thumb-2?
Replies: 12
Views: 345

Re: C compiling in AArch64 only use Thumb-2?

Put the #ifdef in any file you are going to compile .. usually first file AKA very top of main.c The compiler will throw an error if you aren't using an aarch64 compiler The pre-installed version on ubuntu is up to whoever made the package .. no idea what default is. I assume you can use the normal ...
by LdB
Mon Jun 03, 2019 1:56 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

Sorry that does not mean anything to me, what is happening. From what I can work out the RASPI is looping waiting for data from the other device which isn't sending. You can tell it is looping still because of the timeout messages. So I am guessing the attached device is not responding ... any way t...
by LdB
Mon Jun 03, 2019 1:24 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

You might have to ask Gordon if you are allowed to sit in loops like this with wiringPi, it almost looks to me like the linux serial device is blocking. Out of interest lets sleep the thread for a 10ms after each character send .. so yield back to linux void loop() { while(1) { unsigned long timeout...
by LdB
Mon Jun 03, 2019 12:47 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

Yep serialDataAvailable(Serial) was correct substitute The audrino is handshaking it off by look, possibly can't process fast enough because it starts okay and than seems to catch it. You need to fix arduino end .. the RASPI end is now correct :-) What you could do is take the send timeout up to som...
by LdB
Mon Jun 03, 2019 12:25 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

I found it .. try this now has a timeout on both send and recieve void loop() { while(1) { unsigned long timeout; //------------------------------------------------------------- // send char formatstr[MSGLEN]; // debug, cut-down: strcpy(formatstr, "§"); strcat(formatstr, "message from Raspi: %d;\n")...
by LdB
Mon Jun 03, 2019 12:05 pm
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

Ok now try it without the audrino conencted and see if it gets stuck in send loop. If it still loops correctly with the timeout error the problem is on audrino end. Essentially what you are checking is the RASPI cant get stuck anywhere, it should just circulate with timeout errors. The more I look a...
by LdB
Mon Jun 03, 2019 11:43 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

the Raspi received ~7200 loops, and then again it hung up. FYI "stringComplete" is no longer in use stop putting back the lines with it .. it does nothing now on the RASPI code cut them all out. Testing: 1.) Fire the RASPI end but don't send anything from the audrino end and check it times out prop...
by LdB
Mon Jun 03, 2019 11:17 am
Forum: C/C++
Topic: C compiling in AArch64 only use Thumb-2?
Replies: 12
Views: 345

Re: C compiling in AArch64 only use Thumb-2?

The 64 bit compiler is very different it won't even accept those flags you are clearly on the 32bit compiler, from memory the documentation tells you it will just ignore them when it doesn't understand them Install the 64 bit compiler and try again with valid flags like -mcpu=cortex-a53+fp+simd. You...
by LdB
Mon Jun 03, 2019 4:10 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

Still wrong the serialDataAvail(Serial) is problematic .. don't use it. Okay I am going to a guess at the code and I look up arduino and it has a millis() function which I will use for timeout https://www.arduino.cc/reference/en/language/functions/time/millis/ So here is my guess .. will report 2 er...
by LdB
Sun Jun 02, 2019 1:45 am
Forum: C/C++
Topic: code for UART comm from Pi to Arduino hangs up
Replies: 46
Views: 1553

Re: code for UART comm from Pi to Arduino hangs up

Looking at your code there is an obvious problem Follow what happens if Serial.available() returns false :-) The Pi is very fast it will see the gap between characters when the next character is incoming but not yet received, and I would expect that it returns false at times. I suspect you need to s...
by LdB
Tue May 28, 2019 3:22 am
Forum: Bare metal, Assembly language
Topic: DMA 14 & 15 channel irq's
Replies: 0
Views: 1046

DMA 14 & 15 channel irq's

Anyone know what the IRQ numbers for the last 2 of the 15 DMA channels are?

From the linux source code I got the first 13 as irq 16-28 inclusive but then it seems to stop.
by LdB
Sat May 25, 2019 2:28 pm
Forum: Bare metal, Assembly language
Topic: A little Progress on my little OS Project:
Replies: 23
Views: 1250

Re: A little Progress on my little OS Project:

Personally from a baremetal persepective there is a lot of overhead in getting opengl up just to render a few character glyphs simply not worth the effort.
by LdB
Fri May 24, 2019 3:16 pm
Forum: Bare metal, Assembly language
Topic: Any Tutorial to Create a Cross Compiler for ARM? Rpi3
Replies: 5
Views: 466

Re: Any Tutorial to Create a Cross Compiler for ARM? Rpi3

Not sure that is an option jahboater he wants a small kernel which I assume means no linux on the Pi and he obviously wants to compile on a PC. Anyhow RodeX27 yes the 32bit windows executable works fine on x64 windows versions .. I personally have Windows10 64 bit. It is a command line compiler on w...

Go to advanced search