00:00:00 --- log: started forth/20.02.16 00:01:36 like register=SOME_BIT|OTHER_BIT|THIRD_BIT; type thing? 00:02:10 yeah, some of them are pretty horrible imho 00:03:38 C attempts to make register configuration 'easier' I think, but there are so many permutations I think it's a lost cause trying to configure bitfields in groups 00:04:23 Ive been working on various Forth processes to handle this since 2014 now 00:04:50 how would you write it then? 00:05:04 it's no biggie with a 6502 I'm sure, but cortex-m is vastly complex 00:05:12 Ive tried a few ways 00:05:45 I think Ive only scratched the surface really, but the method Im using now is this one 00:06:05 0 SOME_BIT or OTHER_BIT or THIRD_BIT or register ! 00:06:10 I auto generate a word for every bitfield 00:06:17 hmm 00:06:54 no, they have to be auto generated. there are far,far,far too many to do this stuff by hand 00:07:02 here is a example 00:07:11 this is a single bit bitfield 00:07:33 : RCC_CR_HSION %1 0 lshift RCC_CR bis! ; \ RCC_CR_HSION Internal High Speed clock enable 00:07:56 being a single bit, it only has a 'on' or 'off' config 00:08:30 and 'bis' is a Mecrisp-Stellaris word to set a register bit atomically 00:09:15 I plug these into my code via my editor auto insert 00:09:36 then we have a multiple bit bitfield 00:10:20 : GPIOA_CRL_MODE0 ( %XX -- ) 0 lshift GPIOA_CRL bis! ; \ GPIOA_CRL_MODE0 Port n.0 mode bits 00:11:03 or perhaps a better example 00:11:17 : GPIOA_CRL_MODE7 ( %XX -- ) 28 lshift GPIOA_CRL bis! ; \ GPIOA_CRL_MODE7 Port n.7 mode bits 00:11:48 this is for a stm32f103 cortex-m3 which has the ugliest GPIO config ever, but it's 16 years old 00:12:28 so to set that bitfield to %11 Id do this " %11 GPIOA_CRL_MODE7" 00:13:29 the word knows the actual location of the bitfield starts at bit 28 and involves two bits 00:14:31 the cortex-m3 is the worst when it comes to configuring the GPIO's 00:15:02 cortex-m0 is really easy and with the same strategy as above 01:50:29 --- quit: proteus-guy (Ping timeout: 240 seconds) 02:07:13 --- join: pierpal joined #forth 02:25:40 --- join: proteus-guy joined #forth 02:42:45 --- quit: ovf (Ping timeout: 245 seconds) 02:43:09 --- quit: proteus-guy (Ping timeout: 240 seconds) 02:44:56 --- join: ovf joined #forth 02:55:59 --- join: proteus-guy joined #forth 03:03:44 --- join: dys joined #forth 03:16:35 --- quit: pierpal (Read error: Connection reset by peer) 03:16:45 --- join: pierpal joined #forth 04:05:11 --- join: dddddd joined #forth 04:34:54 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 05:42:31 --- quit: pierpal (Remote host closed the connection) 05:51:51 --- quit: jsoft (Ping timeout: 268 seconds) 05:57:14 --- join: pierpal joined #forth 06:13:13 --- quit: pierpal (Ping timeout: 240 seconds) 06:23:09 --- join: pierpal joined #forth 06:28:58 --- quit: pierpal (Read error: Connection reset by peer) 06:34:11 --- join: pierpal joined #forth 06:38:13 --- quit: pierpal (Read error: Connection reset by peer) 06:44:24 --- join: pierpal joined #forth 07:16:36 --- quit: pierpal (Quit: Poof) 07:16:52 --- join: pierpal joined #forth 07:33:05 --- quit: pierpal (Ping timeout: 260 seconds) 07:34:22 --- join: pierpal joined #forth 08:37:01 --- quit: jedb (Ping timeout: 260 seconds) 08:40:49 --- quit: dys (Ping timeout: 268 seconds) 08:44:01 --- quit: pierpal (Ping timeout: 260 seconds) 08:45:12 --- join: actuallybatman joined #forth 08:52:58 --- join: kiesel2 joined #forth 08:56:29 --- quit: kiesel2 (Remote host closed the connection) 08:56:44 --- join: kiesel2 joined #forth 08:58:12 --- quit: kiesel2 (Client Quit) 09:00:00 --- join: pierpal joined #forth 09:05:24 --- join: kiesel2 joined #forth 09:05:47 --- quit: kiesel2 (Remote host closed the connection) 10:00:10 --- join: kiesel2 joined #forth 10:00:32 --- quit: kiesel2 (Client Quit) 10:05:25 --- join: kieselsteini joined #forth 10:08:20 --- quit: actuallybatman (Read error: No route to host) 10:17:45 --- quit: kieselsteini (Quit: Palaver https://palaverapp.com) 10:43:10 --- join: xek joined #forth 11:31:16 --- join: X-Scale` joined #forth 11:32:17 --- quit: X-Scale (Ping timeout: 272 seconds) 11:32:17 --- nick: X-Scale` -> X-Scale 12:24:41 --- join: X-Scale` joined #forth 12:24:45 --- quit: X-Scale (Ping timeout: 260 seconds) 12:25:20 --- nick: X-Scale` -> X-Scale 12:29:25 --- quit: tabemann (Ping timeout: 245 seconds) 12:33:09 --- join: dave0 joined #forth 12:54:16 --- quit: gravicappa (Ping timeout: 268 seconds) 13:05:49 --- join: tabemann joined #forth 13:10:58 --- join: jedb joined #forth 13:38:49 hey guys 14:04:57 --- quit: xek (Ping timeout: 265 seconds) 14:45:42 ughitty ugh ugh ugh 14:45:49 I lost two jumps for my DISCOVERY board 14:46:02 and these were the ones controlling flashing 14:47:19 so i bought a 100-pack of jjumpers 14:47:25 I shouldn't run out this way 14:52:20 --- join: jsoft joined #forth 15:08:01 --- quit: tabemann (Ping timeout: 240 seconds) 16:46:57 99 jumpers left! 17:04:22 --- join: tpbsd joined #forth 17:04:44 --- quit: tp (Read error: Connection reset by peer) 17:11:55 --- join: tabemann joined #forth 17:27:28 tpbsd: have you used Cutter? 17:28:13 tabemann, yes 17:28:29 I'm trying to get it to emulate cortex-m4, with no luck 17:29:40 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 17:29:57 but once that was done it worked pretty well 17:30:19 I only used m0 tho 17:30:47 actually loading an ELF file seems to be working better than trying to load a .bin file 17:31:11 my problem right now is that it sees the addresses as being the Flash-write addresses, not the actual addresses 17:32:13 yeah addressing was a problem, I could never seem to set that but my tests still ran fine 17:34:03 I think I went back to GDB after looking into Cutter, but I was quite impressed 17:34:34 but as a Forth user I never need to run emulation,simulation or gdb anyway 17:35:10 my main reasons were to test some assembly before I ran it on the bare metal 17:35:39 that's exactly what I want it for 17:35:58 because TBH if I try to run it on the disco board it'll probably just do nothing 17:36:10 I want to see how it runs, so I can fix bugs before I try it with the disco board 17:36:19 so it'll have more of a chance of working once I do 17:36:19 my uses are pretty simple, usually altering a usart config etc 17:37:25 I find the assembler errors are usually enough to work out what I have done wrong 17:37:44 and if Im really stuck then I'll try GDB 17:37:53 --- quit: proteus-guy (Ping timeout: 260 seconds) 17:38:42 which is usually when the assembler is happy but the real hardware is playing dead when I run the binary 17:38:47 one problem I have is that the code in one function is showing up as garbage in cutter 17:39:08 in asm it is: 17:39:13 that usually means the wrong ISA in my experience 17:39:41 outer_exc_handled: 17:39:41 bl _init_variables 17:39:41 bl _init_dict 17:39:41 bl _uart_init 17:39:41 bl _use_48mhz 17:39:42 bl _serial_115200_48mhz 17:39:42 bl _init_flash_buffers 17:39:43 bl _do_init 17:39:43 bl _quit 17:39:53 oh I see the fucking problem 17:40:00 it's thinking thumb, not thumb-2 17:40:07 that will do it! 17:40:20 how do I force it to do thumb-2? 17:40:44 i have never tried thumb2 with Cutter 17:41:13 have a look at the initial setup options menu ? 17:42:09 well wait 17:42:19 bl showed up properly in a different place 17:42:25 and thumb-2 always uses the 32-bit bl 17:42:47 I have looked at the initial setupoptions menu 17:44:15 it's the 'advanced' menu I was thinking off 17:44:35 i just looked again and couldnt see any 'thumb' options 17:44:54 there's a "cortex" option 17:45:01 I found I did have to set up all the choices in that menu as 'auto' rarely worked 17:45:36 for instance endianess, number of bits, all that stuff 17:46:22 it's a bit tedious 17:47:26 the best way is to try them all in separate setups 17:47:49 I think I had to use '16' bits for cortex-m 17:53:13 --- quit: tabemann (Ping timeout: 240 seconds) 17:58:42 --- join: tabemann joined #forth 18:00:52 damn machine all but locked up 18:02:03 I didnt have any issues like that 18:02:27 I ran Cutter perhaps 20 times with different configs 18:06:11 ughity ugh ugh ugh 18:06:26 cutter doesn't understand that with cortex the PC has to be *odd* 18:06:59 because the lower bit of the PC is used as a flag indicating whether to execute as thumb or not 18:07:00 ? 18:07:10 and because only thumb is supported, the PC is always odd 18:08:04 it ran my thumb1 code fine 18:08:46 you dont like running GDB ? 18:15:33 no, it's because I need an emulator right now 18:15:47 because I lost two of my jumpers for my disco board 18:16:03 so I can't debug on the board 18:16:16 sure you can 18:16:29 I can't flash my board 18:17:03 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 18:17:34 do it twice to replace the two jumpers 18:18:04 I don't have a piece of stranded wire 18:18:09 I don't have wire strippers 18:18:41 no old cables you can strip ? 18:18:56 nothing to strip them with 18:19:00 you can use a scalpal, sizzors, pliers whatever 18:19:10 a kitchen knife 18:19:23 and anyways I don't have any cables I want to sacrifice 18:19:34 also, I figured out why cutter was corrupting my instructions 18:19:54 once my car broke down, the headlight switch failed at night, and that meant a big fine 18:20:47 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 18:21:38 how about silver paper ? 18:21:45 git any in the kitchen ? 18:22:06 cut into a thin strip and use that instead of wire 18:22:30 the other problem it's not just one jumper 18:22:42 it's two pairs of pins next to one another 18:22:43 it's the two SWD jumpers ? 18:22:50 I don't want to accidentally short between the pairs 18:23:07 yes 18:24:21 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 18:24:48 it will last until your 100 jumpers arrive 18:25:49 you could use bluetack, cotton, paper,carbdoard to hold the silver paper in place 18:29:04 I'm just going to wait for my 100 jumpers 18:29:33 what was interesting was that 30 jumpers were $5 but 100 jumpers were $6 18:29:44 perhaps the quality ? 18:29:50 dunno 18:30:08 there is a *massive* difference in quality of electronics out there 18:30:27 for instance my Discovery boards are circa 2014, and still like new 18:30:53 all I care is that it A) can conduct electricty and B) it stays on the pins, yet comes off when taken off 18:31:04 my STM32F103 boards from China, also 2014 have many rusty pins 18:31:16 *all* ? 18:31:43 you left out c) will continue to conduct electricity in 5 years 18:31:55 that is true 18:32:01 it probably is coming from China 18:32:14 the plating method makes a HUGE difference in price 18:32:33 gold is best, but costs the most 18:33:41 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 18:34:19 I dunno what plating the Chinese boards use but rusty already ? 18:35:34 --- join: boru` joined #forth 18:35:37 --- quit: boru (Disconnected by services) 18:35:40 --- nick: boru` -> boru 18:50:59 back 18:51:09 tpbsd: they're probably using plain steel 18:51:14 not even aluminum 18:52:15 aluminium pins are too weak I think 18:52:39 they arent plain steel, they have some coating but it's pretty usless 18:52:57 even my gold plated pins are steel 18:55:37 oops correction 18:56:04 the olimex and my other gold plated pind are non ferrous, probably brass 18:56:14 the Chinese pins are all steel 18:57:46 --- quit: dave0 (Quit: dave's not here) 18:59:23 okay, gotta head home, bbiab 19:04:13 --- quit: tabemann (Ping timeout: 260 seconds) 19:26:32 --- join: tabemann joined #forth 19:29:41 cya 19:32:00 back 19:32:19 welcome back! 19:35:59 gawd, heres a software guy who discovered embedded in 2010 19:36:21 he writes a embedded book in 2015, only 5 years later 19:36:31 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. " 19:36:48 the blind leading the blind 19:37:37 one person using STM32 after reading his book runs into trouble with ""sub-peripherals" ? 19:37:45 and Structures 19:38:13 namely they dont work with the method shown in 'The Book' 19:38:35 so a 'expert' replies and advises what to do 19:39:19 "Code: [Select] MY_OTG_DEVICE->DIEPMSK 19:39:19 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." 19:39:44 ugh 19:39:46 only one problem, there are TWO registers named "DIEPMSK" 19:39:55 I advise them of this 19:40:05 I don't use C but as there are two "DIEPMSK" registers in this device, perhaps further categorization may be needed ? 19:40:06 \ OTG_FS_DEVICE_FS_DIEPMSK (read-write) 19:40:06 and 19:40:06 \ OTG_HS_DEVICE_OTG_HS_DIEPMSK (read-write) 19:40:53 and the OP goes ahead anyway ignoring me and defines "MY_OTG_DEVICE" anyway 19:41:21 are these Arduino people? 19:41:37 what this means is that the newbie and the expert have no clue about CMSIS-SVD 19:41:58 I dunno, the expert seems to have a clue, the OP is a rank beginner I think 19:42:31 Ive noticed that Cortex-M C users in general don;t have any idea about CMSIS-SVD 19:42:48 because all they do is use libraries 19:43:01 Well C I think 19:43:25 I mean, I have "libraries" also in my Forth dev environment 19:43:44 but Forth deals with bits, and C doesnt 19:43:54 thats the main problem with C I think 19:44:07 you can deal with bits in C 19:44:18 << >> & | ^ ~ 19:44:20 sure, there are workarounds 19:45:01 I bet the stupidity stems from primarily using APIs written by other people 19:45:08 but C has never had a Bit datatype as I understand it 19:45:20 neither does Forth 19:45:37 but Forth exposes the bit-ness of data more 19:46:00 because it doesn't default to abstractions based on things like structs and like 19:46:15 I think the differ`ence is that C was designed to run on mainframes, Forth on hardware 19:46:27 C was designed to run on the PDP-11 19:46:35 which is a mainframe 19:46:50 and I remember reading Brian Kernighan's memoir on the creation of Unix 19:47:20 the first PDP-11 they had had like less than 32KB of RAM 19:47:26 PDP was a computer used in data centres etc, it only had serial terminals, a printer etc ? 19:47:39 yeah, but it didnt have GPIOS 19:47:53 etc 19:47:54 my disco board is far bigger than the first machines they ran Unix on 19:48:12 absolutely, but compare your Disco to a RPI ? 19:48:30 RPI? 19:48:44 One has a ton of GPIOS, ADC, Timers, I2C etc, one doesnt 19:48:49 Rasberry pi 19:49:26 the RPI uses the faster Cortex-not-M's 19:49:34 the RPI is comparable to a lightweight tablet 19:49:37 cortex-a and so on 19:49:42 yeah thats right 19:49:59 whereas the disco is more comparable to old-school minis 19:50:09 but a rpi is a bit like the old PDP-11 in it's intention, ie mainly computing data 19:50:26 no, the minis didnt have the resources of the Disco 19:50:43 the Disco is more like a old micro development system 19:50:56 the SWTP 6800 for instance 19:51:47 they had tons of IO in the way of the old "PIO" chips, which usually had 16 GPIOS, per chip 19:51:59 they also had timer chips, USARTS etc 19:52:23 the two worlds of embedded and computing have become blurry for sure 19:52:58 the old minis were probably more primitive IO-wise, than, say, the C64 19:53:46 and the earlier minis were less powerful too except that they typically came with a drum disk 19:53:52 or disk pack 19:54:11 as opposed to the tape recorders or floppies used by micros 19:56:39 yeah it's hard to tell them apart for purposes of classification today 19:57:29 my definition is "embedded means the device has at least 16 GPIOS, ADC, at least 4 HW timers and micropower capability" 19:57:37 something like that 19:58:03 a RPI isnt 'embedded' to me, it's a computer 20:03:09 I agree 20:10:23 --- join: iyzsong joined #forth 20:12:42 --- quit: dddddd (Ping timeout: 268 seconds) 20:28:44 the original definition of embedded was initially "any computer device not recognizable as a computer, i.e. it is a appliance" 20:29:03 but nowdays a RPI could also fit that definition 20:29:40 aghity agity agh agh agh - why is my stack corrupt, especially since this code doesn't do shit with the stack?! 20:30:21 something is doing stuff with the stack tho 20:32:09 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} 20:34:55 how do you know the stack is corrupt ? 20:36:22 because it's supposed to have an address in flash on its top (or bottom, one could say) 20:37:17 'at one end' is fine :) 20:37:46 perhaps it's not corrupt, perhaps the address isnt saved there ? 20:39:23 the code says it has to be 20:44:54 okay, I'm gonna hit the sack 20:44:56 g'night 20:47:14 cya 21:03:13 --- quit: jsoft (Ping timeout: 260 seconds) 21:05:40 --- join: gravicappa joined #forth 23:38:11 --- quit: pierpal (Ping timeout: 265 seconds) 23:41:21 --- join: pierpal joined #forth 23:59:59 --- log: ended forth/20.02.16