Home / Embedded-Systems / Study-Guide Comments

1 Chapter 4: Selecting the Right MCU (pg 71)

2 Chapter 5: Selecting an IDE (pg 103)

3 Chapter 6: Debugging Tools for Real-Time Systems (pg 127)

3.1 Section:  Creating Ozone projects (page 137)

3.2 Section:  Attaching Ozone to the MCU (page 139)

3.3 Section:  Task-based stack analysis (page 141)

3.4 Section:  Using SystemView (page 142)

 

Chapters 4-6 : bugs, clarifications, and tips

 

 

1  Chapter 4: Selecting the Right MCU (pg 71)

      Commentary

o      This chapter was over my head.  So, I just skimmed it.  I expect it will make more sense later, after getting experience with the technology.

 

2  Chapter 5: Selecting an IDE (pg 103)

      Commentary

o      The first part of this chapter was over my head. So I just skimmed it, up to the section Code generation trade-offs (page 120).

 

      Clarification, pages 123-124

o      The book states, "right-click on Chapter5_6 and select Build"

      There's several build options, but no option "Build".  Use "Build Project".

o      The console output I got looks different than what is shown in the book.  A screen-shot of my console-output is below.

o      These issues are probably due to TrueSTUDIO being used in the book, instead of STM32CubeIDE.  This was described in "Getting started".

 

Text

Description automatically generated

 

      Build error, page 123

o      For the build-system, it's possible to get an error message when running "clean".

o      More info is in the study-guide's web-page on  STM32CubeIDE, in its section "Build clean fails"

 

3  Chapter 6: Debugging Tools for Real-Time Systems (pg 127)

3.1  Section:  Creating Ozone projects (page 137)

      Tip, page 137

o      Check the Ozone console messages, when starting a debug session

      Errors are shown in red font.

      The severity of an error may not be clear.  Errors can vary from being ignorable-warnings to being fatal.

      The messages for a successful start are shown in the page "Ozone".  They can be useful for determining if Ozone started successfully, and for diagnosing problems.

 

      Clarification, page 137

o      This book section shows how to create an Ozone project file (*.jdebug), on pages 137 to 139.

o      If you're working through the book, the instructions shown here in the book are not intended to be followed at this point.  The instructions are for future reference, for when you need to create an Ozone project file.  This is stated in the book, and quoted below.  I overlooked that, and mistakenly tried to follow the instructions, at this point in reading the book.

      All projects included in the source tree for this book already have Ozone projects created for them. The following steps are for your reference—you'll only need to go through these steps for your own future projects. Ozone project files, the *.jdebug files, are already included for all of the projects in this book.

 

      Bug in the book, page 137

o      In the GUI shown, the Peripherals textbox contains an incorrect value

      The value shown is for TrueSTUDIO.

      The value should be for STM32CubeIDE, and probably something like:

C:\ST\STM32CubeIDE_1.5.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.productdb.debug_1.5.0.202011051456\resources\cmsis\STMicroelectronics_CMSIS_SVD\STM32F767.svd

 

3.2  Section:  Attaching Ozone to the MCU (page 139)

      Bug in Ozone, in starting a debug-session, page 139

o      Problem: 

      When starting an Ozone debug-session, Ozone may hang and the debug-session does not fully start. 

      When this has happened, I had been using SystemView prior to using Ozone.  I suspect the problem was due to SystemView not shutting-down properly.

o      This Ozone bug, and others, are described in the study-guide's web-page on Ozone, e.g., the section "Ozone bug:  debug-session does not start properly"

 

      Bugs in the book's code (Chapters5_6.jdebug), page 139

o      There are some bugs in the file Chapters5_6.jdebug.  They need to be fixed in order to use that file and start Ozone.

o      I reported the bugs, and fixes, on the book's GitHub repo, at the link below.  The author's response has additional info.

      https://github.com/PacktPublishing/Hands-On-RTOS-with-Microcontrollers/issues/9

o      As described in the bug-report, the bugs in this file are also present in the other chapters' *.jdebug files.  Those files will need to be fixed as well.

o      There's is an additional bug in the book's *.jdebug files, and it is described below.

o      The bugs in the *.jdebug files are summarized in the study-guide's web-page on Ozone.  It includes a link to a fixed version of Chapters5_6.jdebug.

 

3.3  Section:  Task-based stack analysis (page 141)

      Clarification, page 142

o      The function StartTask3() is in main.c.  In the current version of the code, the function is now called Task3().

 

3.4  Section:  Using SystemView (page 142)

      Bug in book (possible bug), page 144

o      Problem

      Page 144 shows the SystemView configuration to be used.  The frequency specified is 40000, and it may be incorrect.

      There is a different frequency specified in Chapters5_6.jdebug, and it is shown on page 138.  It is: 

      Project.SetTIFSpeed ("50 MHz");

      In my use, SystemView ran when using both of those frequencies specified in the book.  However, SystemView did hang after 14 minutes.  Though, I just tried that once.

      This raises the question of whether the problem was caused by the different frequency-specifications.

o      Solution

      I tried setting SystemView's frequency to 50000 kHz, and SystemView worked, and it did not hang after 50 minutes.

 

      Clarification, page 144

o      The "Play" button shown here is now called the "Start Recording" button.

o      If you've run System View before, for the board, then you won't be prompted with the configuration GUI shown here.  Instead, System View will use the prior configuration. 

o      The SystemView configuration can be changed before clicking on "Start Recording". 

      Click on: Target : Recorder Configuration

 

      Bug in book and Chapters5_6.jdebug, pages 144-145

o      Problem:  SystemView hangs when run in conjunction with an Ozone debug-session

      This can be caused when SystemView's "Start Recording" is started, and an Ozone debug-session is running.

      The book indicates that an Ozone debug-session can be running while SystemView is recording.  However, this is not possible using the book's instructions.

      It may be that those apps used to work like that, when the book was written, but they no longer work like that.

      Example of incorrect instructions, page 144, "To start a [SystemView] capture, make sure you have a running target and your debugger and MCU are connected to the computer:"

o      Solution #1:  in Ozone, disable RTT

      This allows SystemView to be run in conjunction with an Ozone debug-session

      Add this line to the *.jdebug file:

      Project.SetRTT(0);

      Additional info:

      https://forum.segger.com/index.php/Thread/7148-SOLVED-Use-SystemView-3-alongside-Ozone/

      Ozone User Guide & Reference Manual

o      https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology/debugging-features/

o      Solution #2:  don't run an Ozone debug-session when SystemView is recording

      Before starting SystemView's "Start Recording":

      Use Ozone to load and run the program.

      If Ozone is open, an Ozone debug-session must not be running.  If it is running, it can be stopped by clicking on:  Debug : Stop Debug Session.

      Ozone itself can then be closed or left open.

o      A fixed version of Chapters5_6.jdebug

      The bugs in the *.jdebug files are summarized in the study-guide's web-page on Ozone.  It includes a link to a fixed version of Chapters5_6.jdebug.

 

      Tip, page 144

o      The process for starting SystemView is summarized in the study-guide's Cheat-Sheet.

o      The log messages for a successful SystemView connection are shown in the study-guide's web-page on SystemView.  This can be helpful for diagnosing problems in starting SystemView.

 

      Bug in SystemView, page 144

o      Problem:

      It appears there are situations in which SystemView does not close properly.

      These problems can be experienced after closing improperly:

      SystemView cannot be closed

      SystemView cannot be opened again

      When starting an Ozone debug-session, Ozone may hang and the debug-session does not fully start.

      The improper-close seems to occur when exiting System View after it hangs or fails to connect.

o      Solution:

      Disconnect the USB cable for the board

      Use Task Manager to see if any SystemView tasks are running, and end them.

      As a last resort, restart the computer that runs SystemView