<crab1>
tabemann: how you make CREATE and DOES> will depend on some design decisions like threading technique and all but CREATE has to make a word's header and code field from its name and link it to the dictionary then I think before DOES> and (DOES>) you should look at ;CODE and (;CODE).
<rdrop-exit>
2 csr.mvendorid CSR# of 32-bit Machine Vendor ID CSR (R/O).
<rdrop-exit>
4 csr.marchid CSR# of MXLEN-bit Machine Architecture ID CSR (R/O).
<rdrop-exit>
3
<rdrop-exit>
5
<rdrop-exit>
6 csr.mimpid CSR# of MXLEN-bit Machine Implementation ID CSR (R/O).
<rdrop-exit>
7
<tp>
there are valid reasons for a user program wanting to know it
<rdrop-exit>
8 csr.mhartid CSR# of MXLEN-bit Hart ID CSR (R/O).
<rdrop-exit>
9
<rdrop-exit>
a csr.misa CSR# of MXLEN-bit Machine ISA and extensions CSR
<rdrop-exit>
b (WARL).
<tp>
yeah, makes sense
<rdrop-exit>
That's my shadow block for it
<rdrop-exit>
It's accessible in Machine Mode, but not in Supervisor Mode or User Mode
<rdrop-exit>
(and in Debug Mode too of course)
<tp>
i posted a question in a popular forum about it but also added "replies from those with actual experience on this exact matter appreciated"
<rdrop-exit>
:))
<tp>
trying to stop the usual idiots dumping sections of the manual as a reply
<rdrop-exit>
I would assume on the ARM it would be similarly limited, is the program running in ARM's "machine mode" or whatever they call it?
<tp>
ar`m doesnt have modes like that as afaik
<tp>
rather cortex-m
<tp>
I think it only has debug and normal mode
<tp>
and I can read the registers in debug, no problem
<tp>
but I want to be able to read them in user mode. they are listed in the CMSIS-SVD so should be available
<tp>
and they are, but the contents are not (so far)
<rdrop-exit>
that's also the case in small RISC-V, they only have D-Mode and M-Mode, while the bigger chips also have a S-Mode and U-Mode
<rdrop-exit>
(for running OS's and VMs and such)
<rdrop-exit>
Which Cortex-M in particular are you using
<tp>
in this case STM32F103C8
<tp>
which is a STM32F1xx class cortex-m3
<rdrop-exit>
thanks, taking a look
<tp>
I guess youre finding (as I am) that googling will produce millions of hits all the same providing a C user asks it ?
<rdrop-exit>
I usually go to the specs
<tp>
but outside the usual boring and obvous C user questions ... nothing
<tp>
Ive grepped the device specs and thats the only info Ive come up with
<tp>
the info is probably in another more specific ARM doc
<tp>
.. maybe
<rdrop-exit>
"The Cortex-M3 processor supports two operating modes, Thread and Handler and two levels of access for the code, privileged and unprivileged"
<rdrop-exit>
Maybe this priveleged/unpriveleged stuff is the analagous ARM concept
reepca has quit [Read error: Connection reset by peer]
<tp>
eww
<rdrop-exit>
"Code can execute as privileged or unprivileged. Unprivileged execution limits or excludes access to some resources. Privileged execution has access to all resources. Handler mode is always privileged. Thread mode can be privileged or unprivileged."
<tp>
Ive been conveniently ignorant using Forth on this chip
<rdrop-exit>
Perhaps your Forth hides too many of the details
<tp>
and perhaps I'm in 'unprivileged' is what youre thinking ?
<rdrop-exit>
yes
<tp>
I've had no problems until now
<rdrop-exit>
The above quote is from section 3.2.3 of the
<tp>
usually a register that hides the data belongs to a peripheral that is not enabled
<tp>
but debug sounds like the province of the privileged
<tp>
Ill do a grep on "privileged"
<rdrop-exit>
I would assume the *few* debug registers that may be accessible to a program would be limited to the most privileged mode
<tp>
yes, I think youre right
reepca has joined #forth
<rdrop-exit>
I'm jst shooting in the dark of course
<rdrop-exit>
*just
<tp>
it's all we have
<tp>
"priv" is mentioned only 3 times in the entire tech manual and none refer to this issue
<tp>
it does refer to deep debug stuff
<tp>
as you expected
<tp>
there is nothing relating on how to read these registers from inside the mcu
<tp>
I'm desperate now ... ill have to email Matthias!
<rdrop-exit>
that may be covered in a separate Cortex-M3 debug spec
<rdrop-exit>
At least that's how it is with RISC-V
<tp>
I think youre right, but it's odd. generally if thats the case there is *nothing* in the stm tech data or the SVD
<tp>
the fact that these two registers are in the SVD and mentioned in the STMN tech doc normally indicates it's within their province and not arm
<tp>
still there is a ton of docs, bound to be some ommisions and crossovers
<rdrop-exit>
A Machine ID register though, isn't normally a debug register, it should just require that you be in the most priveledged CPU mode right above degug mode, (what RISC-V calls Machine Mode)
<rdrop-exit>
So you shouldn't have to delve into the debug specs for it
<tp>
hell ..
<tp>
I just quit out of debug mode and guess what ?
<tp>
thats straight out of the chip running my new Forth diags prog
<rdrop-exit>
damn, where did I put that barf bag? ;-)
<tp>
i decided to create a 'record' option which generates the XML
<tp>
I did warn you ;-)
<rdrop-exit>
tether tether tether
<rdrop-exit>
(cough cough)
<rdrop-exit>
:)
<rdrop-exit>
better now
<tp>
nah, Ive had 88 downloads of my V1 diags binary and it's all windows mainly arduino users
<rdrop-exit>
cool
<rdrop-exit>
I'm glad you convinced me to go RISC-V instead of ARM
<tp>
it will be a freezing day in hell whan I manage to convince you of anything!
<tp>
hey I've a suggestion song for your daughter, it might suit her style, but it could make her infamous and hated by the left for 1000 years tho ...
<rdrop-exit>
You're insights were whatr put me over the edge :)
<rdrop-exit>
ok
<tp>
"garryowen" along with the flutes etc
<tp>
she could do the original irish version to be a bit safer ?
<rdrop-exit>
not familiar, will mention it to her when we next skype
<tp>
this is the chorus in the Amer`ican version
<tp>
Our hearts so stout have got us fame
<tp>
For soon t'is from whence we came;
<tp>
Where'er we go they dread the name,
<tp>
Of GarrOwen in Glory.
<tp>
think Custer
<rdrop-exit>
she recorded an original song which I quite liked, but she hasn't put it on youtube
<tp>
one has to be very careful thesedays
<rdrop-exit>
singing is just a hobby for her, her real job is acting
<tp>
wow
<tp>
well her` singing is awesome!
<rdrop-exit>
thanks, I'll share that with her!
<tp>
she makes Nancy S sound like a old tired fishwife
<rdrop-exit>
she also dances pretty well, she won on the local TV dance contest, similar to dancing with the stars
<tp>
the irish version is much longer and not about war
<tp>
and it's the original
<tp>
but think what a stir that tune would be on utube sung by your daughter and advertised as 'GarryOwen' ?
<tp>
then again utube might demonetise her :(
<rdrop-exit>
heh
<tp>
well I think the risc-v is a good way to go, it could be massive one day
<tp>
right now the doc sucks and the current die has a few errors
<tp>
but that can all be fixed
<tp>
and I do have a Forth running nicely on it
<tp>
here is one gd32vf103 issue, there is no single command to reset all the registers to defaults
<tp>
unlike cortex-m
<tp>
the doc claims there is, but it's wrong
<tp>
and it's wrong because that part of the doc is a paste from the GD32F103 which is a cortex-m with cloned STM peripherals
<tp>
so thats something to beware, it looks like the GD32VF103 manual started life as a GD32F103 manual with the differences edited
<rdrop-exit>
that particular RISC-V implementation seems oriented to ARM developpers
<tp>
i dont believe thats the reason it exists
<tp>
the STM32F103 has been cloned in China
<tp>
and millions of counterfeit STM32F103C8's now exist, but inside theyre a clone
<rdrop-exit>
the ARM (counterfeit or real) ecosystem
<tp>
thats the reason for my 'diagnostics' binary
<tp>
it attempts to discover if the chip is real or cloned
<rdrop-exit>
cool
<tp>
well V1 did
<tp>
V2 is mainly after the facts ... jack
<tp>
and the XML output is for posterity, so anyone can analyse the user feedback
<rdrop-exit>
FTDI's sample code sucks
<tp>
you said
<tp>
but it's a good choice
<rdrop-exit>
But their MPSSE engine is cool
<tp>
FTDI is probably the market leader ?
<rdrop-exit>
yes
<rdrop-exit>
(at least I think so)
<tp>
ugly as they are
<rdrop-exit>
I wish the internals were documented, I hate using 3rd party libraries
<rdrop-exit>
the open source alternatives don't inspire confidence
<rdrop-exit>
though
<tp>
theyre all reverse engineered I guess ?
<tp>
so how much confidence can you have ?
<rdrop-exit>
right
<rdrop-exit>
plus doing a deep dive into USB would give me ulcers
<tp>
yeah, tho we do have a couple of working Forth examples
<tp>
for a usb-serial bridge that is
<tp>
it's not as bad as I thought but TONS of config
<rdrop-exit>
Tons of options make my nose bleed, I like to pin things down
<tp>
yeah, Ive been afraid of USB for years
<rdrop-exit>
What I would like to eventually do is replace their library with my own code for going from the USB driver to their synchronous serial bridging thingie (MPSSE)
<tp>
but youre doing more than that ? youre goung from usb to JTAG ?
<tp>
ahh that is MPSSE ?
<rdrop-exit>
MPSSE is a feature of their USB chip that receives commands and outputs synchronous serial signals.
<rdrop-exit>
Dealing with JTAG requires configuring the MPSSE output pins and clock, then
<rdrop-exit>
sending sequences through it to make the JTAG TAP controller on the other end dance to your tune.
<tp>
i like it!
<tp>
I may harass you for information later in the year if we are still alive
<rdrop-exit>
:)
<tp>
Im assuming your volcano has decided not to to eradicate all life in Philippines today ?
<rdrop-exit>
although you still have to know what you need to send that JTAG TAP controller for it to in turn make stuff on the target board dance.
<tp>
perhaps tomorrow ?
<tp>
i do know a lot of that
<tp>
it actually seems fairly straightforward
<tp>
hahah, I'm about to make one of the longest Words I'll ever make
<rdrop-exit>
at some level yes, but there's ton's of detail work
<tp>
ever seen a Word 466 lines long ?
<tp>
i'll bet there are some who think that's too long ?
<tp>
hahahahah
<rdrop-exit>
no, impossible
<tp>
no it's not :)
<tp>
I already have some far longer
<rdrop-exit>
are you just comma-ing in 466 lines of data, this is not code right?
<tp>
it's code all right
<rdrop-exit>
like if you do CREATE STUFF 123 , 234 , ... and on and on... that's fine
<tp>
i already have one Word 1541 lines long
<tp>
here is a sample
<rdrop-exit>
You mean a colon definition like : humonguous ( -- ) ... 466 lines ... ; ?
<tp>
no
<tp>
seperate short lines
<tp>
oops. ok, Im weong
<tp>
wrong even
<tp>
it's a file length
<tp>
inside the file are words that are like this
<tp>
( USB - Universal serial bus full-speed device interface )