Hello, I am Mateusz Stadnik. I am a passionate embedded software developer with almost 9 years of commercial experience. I want to share some of my hobby projects on this channel.
If you want to reach me: matgla@live.com
Channels miniature license: "This miniature was created by Copilot, an AI companion."
My goal was to show all steps of the project, but then I realized that it is hard to follow. I hope some day I will find the balance between what to show and what to cut :)
one more thing i felt is that video length is too long, my suggestion is always keep the video under 20 minutes. and have a series instead of single long video.
may be you could lower the volume of music while you are speaking. its bit distracting. i was trying hard to concentrate on what you are saying by replaying multiple times.
I have heard about PIC, but never why it was used, this video explains in a crystal clear manner. and now i have idea about how it does. THanks for the video.
I like the way you have organized the whole project. its something i was thinking if i start my own board bringup. I hope you dont mind if i user your idea :D
I was actually looking for a short video which explains the different steps in involved in Embedded SOftware Development lifecycle, i can the first few videos explained in a very short and sweet manner. The KISS logic - Keep It Short & Simple. Thanks for the video.
To be honest, me too. C can't be substituted in some environments. But whenever it could be I think it should be. I mostly use C++, but I am looking for tools that can improve or even replace it into safer language transpilers ( like cppfront ), where other compilers like (i.e rust are not fitting). But I really hope that the standardization committee will resolve most of the problems some day.
Nice job with Renode simulation ;D I myself tried to implement RP2040 but lack of time and development for other MCU made me drop it for few months. Maybe I will put my hands on it again! Powodzenia ;)
Thanks :) currently I am working on adding PIO simulation for the next part. I think I will release a video on how to use it on other projects. Of course it still will be in work in progress mode with contributions warmly welcome :) in which environment have you tried to implement RP2040?
@@matgla95 to be clear - by implementing I meant Renode implementation. I'm more focused on other MCU series right now ;) looking forward to see the video on how to use Renode. Maybe I'll learn something new from it :D
main(k){while(scanf("%d"))printf("%d ",k++*k/2);} is it a valid solution? It is 3 characters shorter. Also the original version with "%d " gave me segfault so I went with "%d ". I would like to try more but I really don't understand the coding challenge here. Why do we even scan for numbers? The rules are unclear to me, perhaps it's due to traduction from polish.
So, let me clarify a little bit. The code is on SPOJ and is executed for 10 test cases. Test data is provided on STDIN in the form: 1 <- test case 1, n = 1 8 <- test case 2, n = 8 ... rest 8 test cases. Your code should output answers on STDOUT separated by whitespace for each of such test cases. According to segmentation fault. I see two problems in the code that you wrote; scanf in the original code reads a decimal number from STDIN in storing it in the k variable; thus, scanf("%d," &k), otherwise k is uninitialized and scanf depending on libC implementation may segfault, it thinks it has one argument according to format string, but it's not placed in argument list and is writing data to some unexpected memory address (most probably null). Additionally, there is '~' before scanf to detect EOF. Otherwise, the program will not end.
I think beauty is subjective and depends on context. Here I used it a little bit ironically, since you can still do things that should not be allowed, at least by default. Hopefully compilers are evolving and, i.e. GCC 14 rejects such code by default which is good in my opinion!
Out of curiosity, why the GNU GPL rather than the GNU AGPL? The GNU AGPL is stronger and would prevent anyone from taking your operating system and turning it into a cloud service and refusing to give anything back to you. As for the hardware, were you aware of the CERN Open Hardware License when you licensed it? The CERN Open Hardware License 2.0 Strongly Reciprocal is essentially the GPL for hardware rather than software.
Thanks, for that comment! That software is created mainly for educational purposes. I don't think that I will be able to create OS/Bootloader/(What ever else) that is able to compete with any other not single person project. Also I don't see any real usecases to run it over network. It's closely related to specific hardware. For other cases there are better tools available. But if someone will find a way to use it: good for him! :) I selected GPL for software, because I like that part you have to share with community if you wanna use it. But I wasn't digging deep through all licenses availble, I just selected first one that was fine for me. AGPL also fits, but I don't think I will change all license headers right now. About hardware part, it's an experiment. I am only hobbiyst, so I decided to publish with just MIT. Basically to allow anyone to do whatever they want with that.
@@matgla95 One of the good things about the GNU AGPL is that the network use is redistribution clause doesn't really apply if you do not make the software available over a computer network. In that sense it is pretty much identical to the GPL for non networked software, but if anyone turns it into a service as a software substitute then the network use is redistribution clause kicks in immediately.
But it is defined as 'undefined behaviour' the part of the code >>k++*k/2<< since in C theres no defined order of evaluation of operands, k++ could be evaluated before or after k/2 making the result inconsistent and compiler dependent. So lets be aware of that. though if its working for that issue its a fair game
Sure! Good point and that one is even reported by GCC, when using the -Wall flag :) but the goal of that exercise is to abuse whatever you can in the provided compiler to achieve the smallest possible source code
Originally that code doesn't contain . It was added just to better presentation of execution. The testing from SPOJ is executed for many inputs from stdio and space is necessary to separate outputs for test cases.
My First Programming language was python, then I moved to C. When I was Learning python i struggled with logic building. But After learning C im getting better with Logic, and Also Better at JavaScript.
Yes you're right, I have a problem with recording on Linux ( my camera interface produces crazy delays, most probably Nvidia again broke their driver xd ) which I haven't solved yet, so I temporarily switched to windows.
@@matgla95 That's no excuse to have it running in the background. Honestly, I'd be embarrassed. You do you though. I'm sure your excuses will safe you from the social credit system you help implement by running spyware. Oh, and don't get me started on the smart phone which I'm pretty sure you have too.
@@matgla95 You sound like a smoker telling me that smoked meat takes longer to go bad. I guess the copium is always real. Anyway, you keep making excuses for being the corporations' female canine. Another thing though. Are you actually in Poland? We are always looking for Team Fortress people in Europe. I wrote a fork of the original for the Darkplaces engine with more emphasis on tactics and stealth.
Ah yes, because we sure do love writing non portable code! are we forgetting about the fact that C is a systems language? if you need code specific to a certain platform, then use stdint.h types, if you need portable code that works between platforms where you don't know what the width will be, then use standard integer types. I thought this was figured out like 50 years ago, we can't have devolved that much, right...?
@@tiranito2834 why should normal ints be more portable? There is no real point in using normal ints over standard int. Platform dependent types are only necessary for system level interfaces and working with pointers. And in most cases the explicitly platform dependent size_t is all you need. Having the possibility that your int might be "arbitrarily" long depending on the platform might even cause bugs in form of unexpected integer overflow or compile errors in case of to large literals. Tldr always use stdint.h if possible. It makes the code more stable and compatible and portable.
Answering your question about what languages I want to learn are: I've been trying to learn Rust for months, I took courses and read books but I haven't made any progress, I feel stuck, my goal with Rust is the backend, even in the same book it tells you that before that you must know C++. My biggest dream is to master Rust and then C++. that's why I started following your channel, thanks
Yes, Rust/C++ require a lot of time invest. They are really hard to master, but still you can write good code without mastering each piece of a particular language.
I'm an absolute beginner in C programming, watching your video gave me the impetus I need to learn C language upto becoming a master. Thank you and have a felicitous intellectual journey ahead!
And that was one of the reasons that I decided to publish that video :) it's an old challenge and the current solution is easy on the internet to find, so I hoped someone will try to reduce it more! Unfortunately since the whole website is old and I am not even sure it is maintained, the latest compilers are not available.
I always recommend doing actual programs instead of courses. To be honest I almost always boycott most of course, it's too boring for me instead I am using them as a "what to learn next" list. Then think about what program you could wanna write and try to do it. It won't be perfect for the first time, but you can gain real experience and continuously improve it. It could be big or many small ones, but always think how you can improve them after all. When I was taking part in interviews in my previous company always the best candidates were with people that came with projects on GitHub that they prepared by themselves and it was easier for them to adapt to project.
@@matgla95 Let's say I want to learn how like you, where would I start, if there is a lot of information, like the basics without having to go through the courses, the githubs are huge and there are topics in a single repository of different things, the documentation is technical and difficult, as you did at the beginning to later be able to extricate yourself from c, this answer would help me a lot more. greetings
I don't mean to completely drop courses, they are necessary to learn basics. I also started with a course something like " from zero to games coder". And with each exercise I did a similar one on my own. Like it was a random number generation section with exercise with solution, so I did it, but then wrote my own program that also uses random number generation. With some basics I started writing game, since it was fun for me, step by step. With no knowledge it required a lot of internet research, like the first goal: select library, then render black window in OS... Trying to move from courses to reading reference manuals for language and documentation for libraries. Today all those GPT/Copilot could help to speed up information searching on given topic. Starting you may want to write as much as possible on your own, it's reinventing a wheel, but needed if you want to get deep knowledge. But most important is to find a way of learning that makes you fun. If it's not fun most probably you won't be able to spend enough time to grow fast, so the whole road will be longer. Keeping fingers crossed :) Which language you are trying to learn?
@@matgla95 I've been trying to learn Rust for months, I took courses and read books but I haven't made any progress, I feel stuck, my goal with Rust is the backend, even in the same book it tells you that before that you must know C++. My biggest dream is to master Rust and then C++. that's why I started following your channe
Swietny material. Wiecej tego sortu filmikow :) Jakbys jeszcze tylko wrzucal regularnie materialy to mozna by pomyslec o jakies formie wspierania kanalu
Dziękuję! Regularność niestety aktualnie nie wchodzi w grę, choć marzy mi się przyspieszenie montażu (pewnie kwestia wprawy). Kanał rozwijam w swoim wolnym czasie, a do tego dopiero uczę się nagrywania i montażu :) Póki co wystarczy lajk lub miłe słowo :)
Hi! I was teaching myself around 16 years ago. Back then I was using some random c++ course in my native language. I think most important is to spend a lot of time doing exercises. Starting from basics means firstly you need to learn the programmer's way of thinking and problem solving starting from really basic and simple programs. C++ is quite a complex language to learn, but patience and consistency will pay off in the future.
That's only my personal opinion and to say it loud: I have no Rust experience, only years of experience in c++. I did some research that made me think that using Rust it's harder to write unsafe code in some areas ( i.e. memory safety, thread safety ) as opposed to C++. But still in any language you can write unsafe code and in any language you can write safe code (even in assembly or brainf**k, but with more effort spent and easier to introduce buggy unsafe code by mistake). And that covers just language level safety. I think that a much harder point is to implement the whole software architecture as a safe which is more crucial. Maybe we have someone here with both C++ and Rust experience? I am curious about her/his view :)
Słuszne spostrzeżenie. Zwrócę na to uwagę i postaram się, żeby zacząć to wymawiać poprawnie. Mam nadzieję, że w kolejnym odcinku już nie będzie występować ( oraz kilka innych problemów z wymowa i gramatyka :d ). Dzięki!