PV198 - Introduction One-chip Controllers Daniel Dlhopolček, Marek Vrbka, Jan Koniarik, Oldřich Pecák, Tomáš Rohlínek, Ján Labuda, Jan Horáček, Matúš Škvarla, Ondřej Bleha, Martin Klimeš, Adam Valt Faculty of Informatics, Masaryk University 1/2024 Content Content Organization Course overview Lectures Hardware Introduction Hello World MCUXpresso software package MCUXpresso IDE MCUXpresso SDK MCUXpresso Config Tools Homework ·PV198 - Introduction ·1/2024 2 / 23 Organization Organization Course takes place in room A415 13 lessons (2 hours) Maximum of 2 unexcused absences Mandatory homework for every lesson Deadline until next lesson 1/0.5/0 points per homework > 2 points lost = course failure Extra study materials: https://pv198.pages.fi.muni.cz/ Visit the page before the beginning of semester! Exam at the end of course Implement homework-difficulty level task Extra open questions (from study materials, not required if you have colloquium level of completion) ·PV198 - Introduction ·1/2024 3 / 23 Organization Contact You have multiple options to contact us: Never be afraid to ask during your seminars! For questions related to course organization: Jan Labuda (jan.labuda@mail.muni.cz) Discussion forum in IS As an informal alternative, discord server: https://discord.gg/UUyNayBPkk ·PV198 - Introduction ·1/2024 4 / 23 Course overview Course overview We expect you to know the C language You will learn how to write code for micro-controllers You will work with real hardware ·PV198 - Introduction ·1/2024 5 / 23 Lectures Lectures Basic peripherals 2. GPIO 3. Interrupts/Timers 4. PWM 5. ADC Communication interfaces 6. SPI 7. I2C 8. UART I 9. SPI II 10. UART II Advanced peripherals 11. LCD 12. Ethernet ·PV198 - Introduction ·1/2024 6 / 23 Hardware Introduction Hardware Introduction NXP FRDM-K66F Board MK66FN2M0VMD18 MCU 180 MHz 2 MB Flash memory 256 kB SRAM Accelerometer, Magnetometer 3-coloured LED 2 push buttons USB Ethernet Audio ... and more ·PV198 - Introduction ·1/2024 7 / 23 Hardware Introduction ·PV198 - Introduction ·1/2024 8 / 23 Hardware Introduction Links Product page: Main source of information Additional information: Detailed information Get started: Step-by-step guide Board user guide: Information about the board and its peripherals K66 Reference manual: Features and register description K66 data sheet: Technical data about the MCU itself Board schematics ·PV198 - Introduction ·1/2024 9 / 23 Hello World Hello World Task 1 1. Open IDE 2. Setup SDK 3. Import "Hello World" example project ·PV198 - Introduction ·1/2024 10 / 23 Hello World Hello World Project content: ·PV198 - Introduction ·1/2024 11 / 23 Hello World Board folder Folder project/board: Files generated by MCUXPresso Config Tools clock_config pin_mux peripherals Board definitions LEDs buttons debug etc. ·PV198 - Introduction ·1/2024 12 / 23 Hello World Drivers folder Folder project/drivers: SDK files Peripheral control API ·PV198 - Introduction ·1/2024 13 / 23 Hello World Source folder Folder project/source: Your application code Main function ·PV198 - Introduction ·1/2024 14 / 23 MCUXpresso software package MCUXpresso ·PV198 - Introduction ·1/2024 15 / 23 MCUXpresso software package MCUXpresso IDE MCUXpresso IDE Eclipse-based development environment for NXP®MCUs Free Code size unlimited Integrated configuration tools, including pins, clock and peripherals tools Multicore debugging Visualization of registers, variables, heap, stack, ... Can be extended with Eclipse plug-ins ·PV198 - Introduction ·1/2024 16 / 23 MCUXpresso software package MCUXpresso IDE MCUXpresso IDE Console / Terminal Quickstart Panel Project explorer – always select your project Debugging – pause, breakpoints, variables, step over, step into ... Config Tools – open, save, update ·PV198 - Introduction ·1/2024 17 / 23 MCUXpresso software package MCUXpresso SDK MCUXpresso SDK Framework equivalent Production-grade software with integrated RTOS(optional), integrated stacks and middleware, reference software, and more Open-source peripheral drivers that provide stateless, high performance, easy-to-use APIs MISRA-C:2004 compliant and checked with Coverity static analysis tools Stacks/middleware: USB, FatFs, IwIP, SDMMC, TensorFlow, ... API Reference Manual ·PV198 - Introduction ·1/2024 18 / 23 MCUXpresso software package MCUXpresso Config Tools MCUXpresso Config Tools Generate initialization C code Pins tool – assigns internal signals to external pins, sets, electrical properties Clocks tool – graphical representation of the MCU clock tree system Peripherals tool – configures peripherals ·PV198 - Introduction ·1/2024 19 / 23 MCUXpresso software package MCUXpresso Config Tools MCUXpresso Config Tools - Tips Check selected project in the combo box Don’t forget to update the code ·PV198 - Introduction ·1/2024 20 / 23 Homework Automated Testing We have automated test in CI for homeworks, this uses GitLab CI Do not touch the runners or the .gitlab-ci.yml file unless instructed Intentionally sidestepping the testing system will be punished Tests passing do not guarantee that your program is correct, it will always be checked by your TA for code quality, untested parts and intentional sidesteps It is possible our tests are overly strict and a correct program will not pass, reach out to Marek Vrbka (469025@mail.muni.cz or via Discord, there is a channel #ci-issues for it) if you think that is the case Only have one MCUXpresso project in each week ·PV198 - Introduction ·1/2024 21 / 23 Homework Homework We prepared a git repository for each of you: https://gitlab.fi.muni.cz/pv198/2024/ We suggest that you make a new branch for each week, with a name: Week_XX where XX is a number of the week aligned to two characters. For example: Week_01, Week_02, Week_03, ... If you want to submit your homework, create a git tag with name: Submission_XX_Y where XX is a number of the week aligned to two characters, and Y is number of the attempt. There has to be only one project in the tagged commit. For example: Submission_01_0, Submission_01_1, ... ·PV198 - Introduction ·1/2024 22 / 23 Homework Homework Task 2 - Just a repository tag 1. Clone your git repository 2. Create a branch Week_01, push it 3. Create a tag Submission_01_0, push it 4. Check for a result of CI job 5. Tell us if there are any issues (ask your TA to confirm that you tagged it properly) ·PV198 - Introduction ·1/2024 23 / 23