单片机-LAB 3

LAB 3 Page 1 Copyright David Elmo Ross 2019 NAME: _______________________________ STUDENT ID #: ______________________________ LAB 3: Debugging using MCUXpresso LAB SECTION: A B C D E F G H I J K L M N O P OBJECTIVES: 1. To be able to EXPORT an MBED program to MCUXpresso. 2. To be able to IMPORT the program into MCUXpresso. 3. To be able to RUN the program in MCUXpresso. 4. To be able to TROUBLE SHOOT your program by TRACING, Checking Variables, Setting Breakpoints, etc. Please WATCH THIS VIDEO and then: 1. Setup MCUXpresso as shown. Then WATCH THIS VIDEO to see how to Trace code in MCUXpresso 2. Make sure you are signed into your MBED ACCOUNT. 3. Click on THIS LINK to download BLINKING_LED that can be Compiled and Downloaded using MBED onto your FRDM-K64. 4. Compile and download it onto your FRDM-K64 and make sure it works. 5. Click on THIS LINK to download BLINKING_LED_COPY. 6. Export it from MBED to your Downloads folder. 7. Import it into MCUXpresso from your DOWNLOADS folder. 8. Click on the .cpp file and then select the BLUE BUG to download it to your board. 9. RUN it by hitting the ARROW button on the debugger, and make sure that it works. 10. Click on THIS LINK to get the BLINKING_LEDS program. Notice that it has the library needed for MCUXPRESSO. 11. EXPORT this program to MCUXpresso, and make sure that it runs in MCUXpresso. 12. Go BACK to MBED (remember to disconnect and reconnect the cable -no RESET BUTTON). 13. CLONE the BLINKING_LEDS program and change the MBED Library to the one (Documenation not ready). 14. Compile it and download it to DAPLINK, and make sure it works. LAB 3 Page 2 Copyright David Elmo Ross 2019 15. After watching THIS VIDEO, answer the following questions about program lab2_c.cpp DO NOT ATTEMPT TROUBLE SHOOTING SHOWN IN THE VIDEO. MCUxpresso no longer works as shown in the video. When a printf is executed, does the output of the printf immediately go to the screen ________ If you answered NO to the above question, how do you fix this problem _____________________________________________________________________________ When you are troubleshooting code, how is STEP INTO, different from STEP OVER in terms of executing FUNCTIONS _____________________________________________________________________________ _____________________________________________________________________________ 16. After watching THIS VIDEO, answer the following questions about program lab2_b.cpp. DO NOT ATTEMPT TROUBLE SHOOTING SHOWN IN THE VIDEO. MCUxpresso no longer works as shown in the video. When you declared the unsigned char ARRAY name, were all elements of the array preset to some default value __________ In what type of MEMORY (ROM, EEPROM, RAM, FLASH) are variables and arrays stored ___________ In this program what character is put into the ARRAY when the ENTER key is pressed ______ When dealing with STRING arrays, what is the terminating character _______ 17. After exiting MCUXpresso, and returning to the MBED COMPILER, what must you do before you can download any other files to the FRDM-K64 ____________________________________________________________________________