Can ChatGPT program a STM32?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up after the last two videos where I use chat GPT to program an Arduino and an esp32 go check them out if you haven't I wanted to try the next logical step and ask chat gbd to program a stm32 first I'll be asking the AI to write the code in bare metal that is using the registers the stm32 needs to function without using the high level functions and then I'll also be asking the AI to write code using the easier to use STM framework I wanted to brush up on my bare metal C programming and did it first by myself I know this code is quite daunting but I'm just putting some values in these registers let me click on run and wait for it to upload here you can see it blinking every second or so my bare metal programming skills are still up to the task now it's time for chat gbd uh write the program for stm32f4 in bare metal C that blinks a LED in pink pv14 okay so first of all it's using the stm32f4 XX Library which include the registers for all of the gpio let me just ask this time without using the STM for Library now it's correctly casting the H1 Ian beer bus I remember it's that hex value and I don't remember I see in this hex value I also don't remember 18 in the hex value from before so it's probably just calling another part let me create a new project call it open AI blink empty and run it it's compiling nicely so no luck uh let me check the reference manual and here it is it was calling a pin in gpio D when I clearly told it it was a pin um Part B pb14 anyway on to the next question now I want the AI to Blink the bmpv14 using the STM framework so write a program for stm32 that blinks a LED in pv14 now it's using the stm32fr library but it seems to still be using very low level functions it's not using the hardware abstraction layer framework which would make the code much more readable anyway let me copy and create the project uh delete everything and hope that nothing breaks down hit run and it's working so that's a point for the AI but as I said I want the AI to use the hardware abstraction layer functions let me rephrase it write a program for stm32 using the hull that blinks a LED in pin pv14 okay so now it's using the high libraries it's medializing the hull but it's still using the registers uh it seems that the AI doesn't want to use the high gpio toggle function so anyways it's done let me create another project click run and another error I have no idea how to solve that error so let's just cut our losses and try something else next challenge now I'll be using a potentiometer that will deem a lead write a program for stm32 that reads from a potentiometer and dimsa led in pin pv14 according to the value of the potentiometer again it's using the stm32fr library it's enabling the buses and it's not using the functions of the STM framework so I can barely understand these registers anyway let's copy and paste and hope that it works let me create the project paste run it and we have some errors here again no idea how to solve them now on to the last challenge every Arduino has these OLED I squared c-screen let's see if the AI can display hello world I know this is just going to fail horribly because I have never found this Library adapted to the stm32 but anyways write a program for stm32f4 that displays hello world in a SSD 1306 OLED I squared c-screen so it's giving me some instructions on how to do it myself but I don't want to write the code now here's some code it included this SSD 1306 Library which is from Arduino and clearly want to work with an stm32 at least the AI tried well it seems that Chad gbt can barely produce useful code for the stm32 and most of the code it produces uses these low level functions registers and Bay device operations which make the code so hard to read like I just spent an hour trying to fix the potentiometer program and since I have always used the hardware abstraction layer trying to understand this register bit shift it's just too hard anyway I feel quite underwhelmed by the way this AA is performing for embedded programming I mean I see some people that ask the AI to code in python or PHP and it produces some incredible results and I feel quite jealous then again there is so much more information on these languages compared for to for example the hull of the stm32 which at least for me was a bit hard to learn since there wasn't so much information on the internet but I think that this is the best thing that could happen for electronics and Hardware Engineers these microcontrollers are so Niche and the data sheets are so daunting and unintuitive that we will probably be substituted much later and that concludes this video please like the video and comment if you would like me to try something else stay tuned for the next video
Info
Channel: Hanqaqa
Views: 30,443
Rating: undefined out of 5
Keywords:
Id: 7yxv459OWfs
Channel Id: undefined
Length: 9min 52sec (592 seconds)
Published: Thu Dec 29 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.