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 ?