<tp> 99 jumpers left!
tpbsd has joined #forth
tp has quit [Read error: Connection reset by peer]
tabemann has joined #forth
<tabemann> tpbsd: have you used Cutter?
<tpbsd> tabemann, yes
<tabemann> I'm trying to get it to emulate cortex-m4, with no luck
<tpbsd> tabemann, it's a bit rough around the edges I think, because I had to set the cpu via a initial menu every time I set up a new program tp emulate
<tpbsd> but once that was done it worked pretty well
<tpbsd> I only used m0 tho
<tabemann> actually loading an ELF file seems to be working better than trying to load a .bin file
<tabemann> my problem right now is that it sees the addresses as being the Flash-write addresses, not the actual addresses
<tpbsd> yeah addressing was a problem, I could never seem to set that but my tests still ran fine
<tpbsd> I think I went back to GDB after looking into Cutter, but I was quite impressed
<tpbsd> but as a Forth user I never need to run emulation,simulation or gdb anyway
<tpbsd> my main reasons were to test some assembly before I ran it on the bare metal
<tabemann> that's exactly what I want it for
<tabemann> because TBH if I try to run it on the disco board it'll probably just do nothing
<tabemann> I want to see how it runs, so I can fix bugs before I try it with the disco board
<tabemann> so it'll have more of a chance of working once I do
<tpbsd> my uses are pretty simple, usually altering a usart config etc
<tpbsd> I find the assembler errors are usually enough to work out what I have done wrong
<tpbsd> and if Im really stuck then I'll try GDB
proteus-guy has quit [Ping timeout: 260 seconds]
<tpbsd> which is usually when the assembler is happy but the real hardware is playing dead when I run the binary
<tabemann> one problem I have is that the code in one function is showing up as garbage in cutter
<tabemann> in asm it is:
<tpbsd> that usually means the wrong ISA in my experience
<tabemann> outer_exc_handled:
<tabemann> bl _init_variables
<tabemann> bl _use_48mhz
<tabemann> bl _uart_init
<tabemann> bl _init_dict
<tabemann> bl _serial_115200_48mhz
<tabemann> bl _init_flash_buffers
<tabemann> bl _do_init
<tabemann> bl _quit
<tabemann> oh I see the fucking problem
<tabemann> it's thinking thumb, not thumb-2
<tpbsd> that will do it!
<tabemann> how do I force it to do thumb-2?
<tpbsd> i have never tried thumb2 with Cutter
<tpbsd> have a look at the initial setup options menu ?
<tabemann> well wait
<tabemann> bl showed up properly in a different place
<tabemann> and thumb-2 always uses the 32-bit bl
<tabemann> I have looked at the initial setupoptions menu
<tpbsd> it's the 'advanced' menu I was thinking off
<tpbsd> i just looked again and couldnt see any 'thumb' options
<tabemann> there's a "cortex" option
<tpbsd> I found I did have to set up all the choices in that menu as 'auto' rarely worked
<tpbsd> for instance endianess, number of bits, all that stuff
<tpbsd> it's a bit tedious
<tpbsd> the best way is to try them all in separate setups
<tpbsd> I think I had to use '16' bits for cortex-m
tabemann has quit [Ping timeout: 240 seconds]
tabemann has joined #forth
<tabemann> damn machine all but locked up
<tpbsd> I didnt have any issues like that
<tpbsd> I ran Cutter perhaps 20 times with different configs
<tabemann> ughity ugh ugh ugh
<tabemann> cutter doesn't understand that with cortex the PC has to be *odd*
<tabemann> because the lower bit of the PC is used as a flag indicating whether to execute as thumb or not
<tpbsd> ?
<tabemann> and because only thumb is supported, the PC is always odd
<tpbsd> it ran my thumb1 code fine
<tpbsd> you dont like running GDB ?
<tabemann> no, it's because I need an emulator right now
<tabemann> because I lost two of my jumpers for my disco board
<tabemann> so I can't debug on the board
<tpbsd> sure you can
<tabemann> I can't flash my board
<tpbsd> get a piece of stranded wire and strip the insulation, remove one strand then using tweezers wind that strand around the two pins in question
<tpbsd> do it twice to replace the two jumpers
<tabemann> I don't have a piece of stranded wire
<tabemann> I don't have wire strippers
<tpbsd> no old cables you can strip ?
<tabemann> nothing to strip them with
<tpbsd> you can use a scalpal, sizzors, pliers whatever
<tpbsd> a kitchen knife
<tabemann> and anyways I don't have any cables I want to sacrifice
<tabemann> also, I figured out why cutter was corrupting my instructions
<tpbsd> once my car broke down, the headlight switch failed at night, and that meant a big fine
<tpbsd> I had a wall wart type charger in the car, and no tools, so i managed to break the cable on the wall wart, stripped the ends with my teeth and hard wired the headlights with it
<tpbsd> how about silver paper ?
<tpbsd> git any in the kitchen ?
<tpbsd> cut into a thin strip and use that instead of wire
<tabemann> the other problem it's not just one jumper
<tabemann> it's two pairs of pins next to one another
<tpbsd> it's the two SWD jumpers ?
<tabemann> I don't want to accidentally short between the pairs
<tabemann> yes
<tpbsd> nothing bad would happen, but it's easy, wind silver paper around the two sets of two pins, then use some cardboard or paper to make sure that the silber paper stays and doesnt short out the adjacent pins
<tpbsd> it will last until your 100 jumpers arrive
<tpbsd> you could use bluetack, cotton, paper,carbdoard to hold the silver paper in place
<tabemann> I'm just going to wait for my 100 jumpers
<tabemann> what was interesting was that 30 jumpers were $5 but 100 jumpers were $6
<tpbsd> perhaps the quality ?
<tabemann> dunno
<tpbsd> there is a *massive* difference in quality of electronics out there
<tpbsd> for instance my Discovery boards are circa 2014, and still like new
<tabemann> all I care is that it A) can conduct electricty and B) it stays on the pins, yet comes off when taken off
<tpbsd> my STM32F103 boards from China, also 2014 have many rusty pins
<tpbsd> *all* ?
<tpbsd> you left out c) will continue to conduct electricity in 5 years
<tabemann> that is true
<tabemann> it probably is coming from China
<tpbsd> the plating method makes a HUGE difference in price
<tpbsd> gold is best, but costs the most
<tpbsd> my Olimex boards are like new, and they have all gold plated pins but were about $65 compared to the Chinese boards at $9. The olimex also has many more connectors, it's really 10x the Chinese board
<tpbsd> I dunno what plating the Chinese boards use but rusty already ?
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
<tabemann> back
<tabemann> tpbsd: they're probably using plain steel
<tabemann> not even aluminum
<tpbsd> aluminium pins are too weak I think
<tpbsd> they arent plain steel, they have some coating but it's pretty usless
<tpbsd> even my gold plated pins are steel
<tpbsd> oops correction
<tpbsd> the olimex and my other gold plated pind are non ferrous, probably brass
<tpbsd> the Chinese pins are all steel
dave0 has quit [Quit: dave's not here]
<tabemann> okay, gotta head home, bbiab
tabemann has quit [Ping timeout: 260 seconds]
tabemann has joined #forth
<tpbsd> cya
<tabemann> back
<tpbsd> welcome back!
<tpbsd> gawd, heres a software guy who discovered embedded in 2010
<tpbsd> he writes a embedded book in 2015, only 5 years later
<tpbsd> now he says this "In 2015 I started writing a book about STM32 microcontrollers. It's published through the LeanPub platform, which allows to publish in-progress books. I started writing it just for fun. And now it's considered the best book about this subject. A lot of universities, companies and individuals are adopting it as main reference of this exciting MCU portfolio. "
<tpbsd> the blind leading the blind
<tpbsd> one person using STM32 after reading his book runs into trouble with ""sub-peripherals" ?
<tpbsd> and Structures
<tpbsd> namely they dont work with the method shown in 'The Book'
<tpbsd> so a 'expert' replies and advises what to do
<tpbsd> "Code: [Select] MY_OTG_DEVICE->DIEPMSK
<tpbsd> I've used the name MY_OTG_DEVICE so it doesn't clash if STM decides to make a definition for it in the future and uses the more obvious name USB_OTG_DEVICE."
<tabemann> ugh
<tpbsd> only one problem, there are TWO registers named "DIEPMSK"
<tpbsd> I advise them of this
<tpbsd> I don't use C but as there are two "DIEPMSK" registers in this device, perhaps further categorization may be needed ?
<tpbsd> and
<tpbsd> \ OTG_FS_DEVICE_FS_DIEPMSK (read-write)
<tpbsd> \ OTG_HS_DEVICE_OTG_HS_DIEPMSK (read-write)
<tpbsd> and the OP goes ahead anyway ignoring me and defines "MY_OTG_DEVICE" anyway
<tabemann> are these Arduino people?
<tpbsd> what this means is that the newbie and the expert have no clue about CMSIS-SVD
<tpbsd> I dunno, the expert seems to have a clue, the OP is a rank beginner I think
<tpbsd> Ive noticed that Cortex-M C users in general don;t have any idea about CMSIS-SVD
<tabemann> because all they do is use libraries
<tpbsd> Well C I think
<tpbsd> I mean, I have "libraries" also in my Forth dev environment
<tpbsd> but Forth deals with bits, and C doesnt
<tpbsd> thats the main problem with C I think
<tabemann> you can deal with bits in C
<tabemann> << >> & | ^ ~
<tpbsd> sure, there are workarounds
<tabemann> I bet the stupidity stems from primarily using APIs written by other people
<tpbsd> but C has never had a Bit datatype as I understand it
<tabemann> neither does Forth
<tabemann> but Forth exposes the bit-ness of data more
<tabemann> because it doesn't default to abstractions based on things like structs and like
<tpbsd> I think the differ`ence is that C was designed to run on mainframes, Forth on hardware
<tabemann> C was designed to run on the PDP-11
<tpbsd> which is a mainframe
<tabemann> and I remember reading Brian Kernighan's memoir on the creation of Unix
<tabemann> the first PDP-11 they had had like less than 32KB of RAM
<tpbsd> PDP was a computer used in data centres etc, it only had serial terminals, a printer etc ?
<tpbsd> yeah, but it didnt have GPIOS
<tpbsd> etc
<tabemann> my disco board is far bigger than the first machines they ran Unix on
<tpbsd> absolutely, but compare your Disco to a RPI ?
<tabemann> RPI?
<tpbsd> One has a ton of GPIOS, ADC, Timers, I2C etc, one doesnt
<tpbsd> Rasberry pi
<tpbsd> the RPI uses the faster Cortex-not-M's
<tabemann> the RPI is comparable to a lightweight tablet
<tpbsd> cortex-a and so on
<tpbsd> yeah thats right
<tabemann> whereas the disco is more comparable to old-school minis
<tpbsd> but a rpi is a bit like the old PDP-11 in it's intention, ie mainly computing data
<tpbsd> no, the minis didnt have the resources of the Disco
<tpbsd> the Disco is more like a old micro development system
<tpbsd> the SWTP 6800 for instance
<tpbsd> they had tons of IO in the way of the old "PIO" chips, which usually had 16 GPIOS, per chip
<tpbsd> they also had timer chips, USARTS etc
<tpbsd> the two worlds of embedded and computing have become blurry for sure
<tabemann> the old minis were probably more primitive IO-wise, than, say, the C64
<tabemann> and the earlier minis were less powerful too except that they typically came with a drum disk
<tabemann> or disk pack
<tabemann> as opposed to the tape recorders or floppies used by micros
<tpbsd> yeah it's hard to tell them apart for purposes of classification today
<tpbsd> my definition is "embedded means the device has at least 16 GPIOS, ADC, at least 4 HW timers and micropower capability"
<tpbsd> something like that
<tpbsd> a RPI isnt 'embedded' to me, it's a computer
<tabemann> I agree
iyzsong has joined #forth
dddddd has quit [Ping timeout: 268 seconds]
<tpbsd> the original definition of embedded was initially "any computer device not recognizable as a computer, i.e. it is a appliance"
<tpbsd> but nowdays a RPI could also fit that definition
<tabemann> aghity agity agh agh agh - why is my stack corrupt, especially since this code doesn't do shit with the stack?!
<tpbsd> something is doing stuff with the stack tho
<tabemann> in this code, I first do a TRY, then I simply run initialization code where the only rstack ops are push {lr} and pop {pc}
<tpbsd> how do you know the stack is corrupt ?
<tabemann> because it's supposed to have an address in flash on its top (or bottom, one could say)
<tpbsd> 'at one end' is fine :)
<tpbsd> perhaps it's not corrupt, perhaps the address isnt saved there ?
<tabemann> the code says it has to be
<tabemann> okay, I'm gonna hit the sack
<tabemann> g'night
<tpbsd> cya
jsoft has quit [Ping timeout: 260 seconds]
gravicappa has joined #forth
pierpal has quit [Ping timeout: 265 seconds]
pierpal has joined #forth
mtsd has joined #forth
pierpal has quit [Ping timeout: 268 seconds]
jsoft has joined #forth
dys has joined #forth
xek has joined #forth
Deep-Thought has joined #forth
Deep-Thought has quit [Quit: Leaving]
pierpal has joined #forth
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #forth
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #forth