Go to advanced search

by LdB
Mon Dec 10, 2018 11:48 pm
Forum: Bare metal, Assembly language
Topic: CSUD - Chadderz's Simple USB Driver (Source)
Replies: 52
Views: 13842

Re: CSUD - Chadderz's Simple USB Driver (Source)

The DMA transfer section needs to be fixed up to a non cache address the raw address CSUD uses in DMA will only work on a Pi1. Basically OR 0xC0000000 to any address passed to the DMA ... if you do not yet understand why you will need to read up on it. https://www.raspberrypi.org/documentation/hardw...
by LdB
Mon Dec 10, 2018 11:42 pm
Forum: Bare metal, Assembly language
Topic: HELP! ARM ASSEMBLY PROJECT
Replies: 16
Views: 473

Re: HELP! ARM ASSEMBLY PROJECT

Ok there is problems here, remember the two requirements above 1.) set the gpio mode to input 2.) read the gpio That code does not deal with the setting of the port to input it assumes you have done it ...did you do it? You also do not show us what you set in register r0 it is reliant on that .. so ...
by LdB
Mon Dec 10, 2018 12:25 pm
Forum: Bare metal, Assembly language
Topic: HELP! ARM ASSEMBLY PROJECT
Replies: 16
Views: 473

Re: HELP! ARM ASSEMBLY PROJECT

I tried what you suggested. But for some reason the button doesn’t seem to respond. That’s why I asked again! But thanks for your help! What exactly did you try (description required with code it should probably be less than 10 lines of code) and what did it do (description required)? We can only h...
by LdB
Mon Dec 10, 2018 8:01 am
Forum: Bare metal, Assembly language
Topic: HELP! ARM ASSEMBLY PROJECT
Replies: 16
Views: 473

Re: HELP! ARM ASSEMBLY PROJECT

I am not sure how anyone can help more as you do not appear to have tried anything suggested. 1.) You are clearly working in linux with wiringpi library so for many of us here not something we generally play with as we would do it raw baremetal ... no linux no wiringpi. Given your current problem th...
by LdB
Sat Dec 08, 2018 3:32 pm
Forum: Bare metal, Assembly language
Topic: Building code with newlib-nano
Replies: 2
Views: 70

Re: Building code with newlib-nano

__aeabi_idiv etc is part of the GCC internal library

-lgcc is needed as well as -lm -lc etc
by LdB
Sat Dec 08, 2018 7:46 am
Forum: Bare metal, Assembly language
Topic: Assembly challange
Replies: 12
Views: 444

Re: Assembly challange

It is easy merge into a single file .. very common thing
http://infocenter.arm.com/help/index.js ... 15171.html
by LdB
Thu Dec 06, 2018 7:10 pm
Forum: Bare metal, Assembly language
Topic: Assembly challange
Replies: 12
Views: 444

Re: Assembly challange

Okay how about this .. you end up executing 32 bit code at 0x8000 even in AARCH64 .data .globl I_AM_64_BIT; I_AM_64_BIT : .4byte 0; .org 0x8000 // If you start here you are AARCH32 from ARMSTUB.S, ARMSTUB7.S // If I_AM_64_BIT = 1 ... you are actually now AARCH32 running under AAARCH64 // Execute you...
by LdB
Thu Dec 06, 2018 4:29 pm
Forum: Bare metal, Assembly language
Topic: HELP! ARM ASSEMBLY PROJECT
Replies: 16
Views: 473

Re: HELP! ARM ASSEMBLY PROJECT

As suggested do a search for C code .. and compile it to verbose assembler so you can work with it If you take a C polled version it does something like this // scanButton .. wait for the button to be let-go void scanButton (int button) { if (digitalRead (button) == HIGH) // Low is pushed return ; w...
by LdB
Thu Dec 06, 2018 1:10 pm
Forum: Bare metal, Assembly language
Topic: HELP! ARM ASSEMBLY PROJECT
Replies: 16
Views: 473

Re: HELP! ARM ASSEMBLY PROJECT

You are using wiring pi library (all be it calling it from assembly) and there are already piles of examples out there ... Do a search "wiringpi button example" it will give you a pile of ideas and code. There is no right and wrong way to do it, you basically just read a GPIO port that is setup with...
by LdB
Tue Dec 04, 2018 5:20 pm
Forum: Bare metal, Assembly language
Topic: LdB's FreeRTOS example
Replies: 9
Views: 939

Re: LdB's FreeRTOS example

I had a bit of time over weekend to finish the Pi3 AARCH64 bit version of FreeRTOS 10.1.1

https://github.com/LdB-ECM/Raspberry-Pi ... TOSv10.1.1

Should now work on any model Pi in 32 bit and either Pi3 model in 32 or 64 bit.
by LdB
Sun Dec 02, 2018 9:45 am
Forum: Bare metal, Assembly language
Topic: Assembly challange
Replies: 12
Views: 444

Re: Assembly challange

1.) Formally you can read the CPU id for an ARM6 & ARM7 if it's either of those it has to be AARCH32. 2.) So then you come to an ARM8 It's still actually trivial the hint is look at the behaviour with an unknown opcode :-) For example if GCC have done there job properly try void __builtin_trap (void...
by LdB
Fri Nov 30, 2018 1:21 am
Forum: Bare metal, Assembly language
Topic: Assembly challange
Replies: 12
Views: 444

Re: Assembly challange

There is an obvious solution which is to pseudocode the opcodes, is that a valid or are we restricted to actual true assembler? To some degree GCC already has pseudocoding in things like "ldr x1, =somevar" The obvious most elegant answer to me is a simple include of a file with the assembler in it, ...
by LdB
Sat Nov 24, 2018 4:01 am
Forum: Bare metal, Assembly language
Topic: Weird. foo(char* fmt, ...) works on EL2 but doesn't work on EL1.
Replies: 5
Views: 324

Re: Weird. foo(char* fmt, ...) works on EL2 but doesn't work on EL1.

I initially said there were two errors with code on re-reading the C standard I am going to amend this to 1. It is valid to not use a variadic argument and not have to tell the compiler it is a special case of passing variables. Your code as shown shouldn't compile and throw a fatal error the fact t...
by LdB
Fri Nov 23, 2018 5:28 pm
Forum: Bare metal, Assembly language
Topic: Bare metal graphics : hardware acceleration ?
Replies: 11
Views: 1413

Re: Bare metal graphics : hardware acceleration ?

It is not the rectangles or triangles that is the problem it is always the text and bitmaps that causes the problems with speed. I will have more to show and say on this in weeks ahead but I am already spread too thin on multiple things. I will leave you good people to try different approaches.
by LdB
Fri Nov 23, 2018 3:14 am
Forum: Bare metal, Assembly language
Topic: FAST RAM
Replies: 10
Views: 451

Re: FAST RAM

I can do that .. it's not very exciting .. it uses a PC for display so not aimed at portable market so not sure it is terribly useful :-) There is an old xilinx design example (xapp154.pdf) which gives you the code and the simple R/C setup you need to build the A/D into a fpga. Some of the newer Xil...
by LdB
Thu Nov 22, 2018 4:27 pm
Forum: Bare metal, Assembly language
Topic: FAST RAM
Replies: 10
Views: 451

Re: FAST RAM

We spent a fair bit of time messing around looking at making a cheap high speed digital storage scope but physically there are limits The output mode is documented on the net by Henner Zeller https://github.com/hzeller/rpi-gpio-dma-demo The read was not significantly different and there is definitel...
by LdB
Thu Nov 22, 2018 6:16 am
Forum: Bare metal, Assembly language
Topic: FAST RAM
Replies: 10
Views: 451

Re: FAST RAM

I still don't believe it will change the fact the GPIO bus is slow and you still are limited. The max gpio speed is 71Mhz the core is doing 1400Mhz that is a 20 to 1 ratio and you can loop it on 3 cycle loop. If it was capable of going faster it already would.
by LdB
Wed Nov 21, 2018 1:16 pm
Forum: Bare metal, Assembly language
Topic: Raspberry Pi 3 64-bit kernel entry
Replies: 1
Views: 364

Re: Raspberry Pi 3 64-bit kernel entry

It's virtualized via the MMU unit. There is a couple threads on here including one a few posts back but you need to do basic reading on MMU and virtualization before any of it makes sense as it is one of the most complex areas to understand. The entries are you described physically but once you turn...
by LdB
Wed Nov 21, 2018 5:50 am
Forum: Bare metal, Assembly language
Topic: Help with this assembly code
Replies: 26
Views: 1085

Re: Help with this assembly code

http://www.keil.com/support/man/docs/armasm/armasm_dom1361289878994.htm Its MOV Destination register, Source Register So mov r1, r4 /*r1 contains pointer to value_read1 That writes R4 into R1 .. so if R1 contains your answer or a pointer to it you just killed the answer mov r4, r1 That writes R1 int...
by LdB
Wed Nov 21, 2018 5:03 am
Forum: Bare metal, Assembly language
Topic: Help with this assembly code
Replies: 26
Views: 1085

Re: Help with this assembly code

ldr r0, =response /*r0 contains pointer to response message*/ mov r1, r4 /*r1 contains pointer to value_read1*/ <<< check mov goes right to left ldr r1, [r1] /*r1 contains value dereferenced from r1 in previous instruction*/ mov r2, r5 <<< check mov goes right to left ldr r2, [r2] mov r3, r6 <<<< c...
by LdB
Wed Nov 21, 2018 3:55 am
Forum: Bare metal, Assembly language
Topic: Help with this assembly code
Replies: 26
Views: 1085

Re: Help with this assembly code

How can we help you haven't told us what it does wrong. :-) It looks like it assumes it has access to the standard C libraries in some manner, I assume a linker command about which you said nothing. I can see it is supposed to print a display message, take 3 numbers from a user and add them up and d...
by LdB
Wed Nov 21, 2018 3:05 am
Forum: Bare metal, Assembly language
Topic: SP_EL3 ?
Replies: 11
Views: 932

Re: SP_EL3 ?

Close but no cigar .. the SP is moving a bit +0 to +32 from the value I set it. It would appears sometimes it pulls stuff back off the stack on the eret other times not. I am even more mystified now. I assume there must be a flag to tell me if it's going to pull back the stack on return searching do...
by LdB
Wed Nov 21, 2018 2:04 am
Forum: Bare metal, Assembly language
Topic: SP_EL3 ?
Replies: 11
Views: 932

Re: SP_EL3 ?

Thanks for reminding me I have been doing to much AAARCH32 lately and not enough coffee :-)

Yeah so I can just move the SP inside the IRQ because I am EL1 and do the eret and all should work .. lets see if I can get FreeRTOS doing 64 bit.
by LdB
Wed Nov 21, 2018 1:49 am
Forum: Bare metal, Assembly language
Topic: Failure to link a library
Replies: 6
Views: 858

Re: Failure to link a library

Generally that is a larger question with what you are going to do on the Pi. In baremetal we have nothing, no file system, no screen no peripherals of any kind. From that we write everything ourself and we build the system up. It's a place you go to either learn things or develop things. So in barem...
by LdB
Tue Nov 20, 2018 5:49 pm
Forum: Bare metal, Assembly language
Topic: LdB's FreeRTOS example
Replies: 9
Views: 939

Re: LdB's FreeRTOS example

Finished 10.1.1 port .. Technically it is 10.1.2 because I added the 10 lines to give CPU load which they dont have. https://github.com/LdB-ECM/Raspberry-Pi/tree/master/FreeRTOSv10.1.1 I have all but finished the AARCH64 I just have an issue with getting the stack switching I need to do an elevate t...

Go to advanced search