<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MBD toolbox does not allow using an external oscillator on SOSC(critical/potential hardware fail in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-toolbox-does-not-allow-using-an-external-oscillator-on-SOSC/m-p/1498838#M7575</link>
    <description>&lt;P&gt;This is great information.&lt;/P&gt;&lt;P&gt;A bit more digging thru the datasheet reveals the source of my confusion; the SOSC module is referred to as the system oscillator in some sections, while in others it is referred to as the external reference clock.&lt;/P&gt;&lt;P&gt;Additionally in chapter 28, under the description of the EREFS bit, it says&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;External Reference Select&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Selects the source for the &lt;EM&gt;external reference clock&lt;/EM&gt;. This bit selects which clock is output from the System&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;OSC (SOSC) into the SCG, thus either the crystal oscillator or from an external clock input&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;0 External reference clock selected&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;1 Internal crystal oscillator of OSC selected.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The data sheet should probably be amended here (where italicized), and in the other parts which call it the "external reference clock" instead of the system oscillator (such as in the watchdog timer module section), to instead refer to it as the "System Oscillator Clock".&amp;nbsp; This bit is switching between an external clock signal at valid digital input levels (external reference) or a buffer which is sampling the output of the internal amplifier (used for driving a crystal).&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2022 13:09:47 GMT</pubDate>
    <dc:creator>glenndoiron</dc:creator>
    <dc:date>2022-08-01T13:09:47Z</dc:date>
    <item>
      <title>MBD toolbox does not allow using an external oscillator on SOSC(critical/potential hardware failure)</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-toolbox-does-not-allow-using-an-external-oscillator-on-SOSC/m-p/1498113#M7567</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Using : MBDToolbox 4.2.1,with hotfix for register access blocks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using: S32K144 LQFP-100, on proprietary hardware board&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The dropdown box for XTAL Frequency does not display the option to use the onboard oscillator module; the "External 8" option misleadingly suggests it is for an external oscillator, but actually configures the onboard oscillator module.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When the block is configured as "External 8", the following code is generated in the s32k_clock_init.c file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.soscConfig =&lt;BR /&gt;{&lt;BR /&gt;.initialize = true, /* Initialize */&lt;BR /&gt;.freq = XTAL_FREQ, /* Frequency */&lt;/P&gt;&lt;P&gt;/* SOSCCSR */&lt;BR /&gt;.monitorMode = SCG_SOSC_MONITOR_DISABLE,/* SOSCCM */&lt;BR /&gt;.locked = false, /* LK */&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* SOSCCFG */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.extRef = SCG_SOSC_REF_OSC, /* EREFS */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.gain = SCG_SOSC_GAIN_LOW, /* HGO */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.range = SCG_SOSC_RANGE_HIGH, /* RANGE */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* SOSCDIV */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.div1 = MBDT_SOSCDIV,/* SOSCDIV1 */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.div2 = MBDT_SOSCDIV,/* SOSCDIV2 */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;},&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This configures the SOSC module with EREFS=1,&amp;nbsp; which selects the internal oscillator amplifier module as the source of the clock (instead of the external reference clock on pin EXTAL).&lt;/P&gt;&lt;P&gt;Page 90 of the S32 reference manual (4.5.1) states&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;If oscillator is enabled then enabling the GPIO or LPI2C&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;function for EXTAL/XTAL pins can lead to device damage.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;This must be avoided by software.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am using an external oscillator (square wave) to drive the EXTAL pin, and I dodged a bullet here as I did not connect XTAL on my board or configure any I/O on the pin.&lt;/P&gt;&lt;P&gt;The current options should be relabelled as "Internal crystal oscillator 8", and new options for "External Oscillator 8" should be added&amp;nbsp; which set EREFS=0.&lt;/P&gt;&lt;P&gt;Additonally, it would be good to issue a warning when the internal oscillator is used with a link to seciton 4.5.1 of the manual and that the EXTAL/XTAL pins should not be configured for use by any peripherals other than the SOSC module.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:17:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-toolbox-does-not-allow-using-an-external-oscillator-on-SOSC/m-p/1498113#M7567</guid>
      <dc:creator>glenndoiron</dc:creator>
      <dc:date>2022-07-29T15:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: MBD toolbox does not allow using an external oscillator on SOSC(critical/potential hardware fail</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-toolbox-does-not-allow-using-an-external-oscillator-on-SOSC/m-p/1498752#M7573</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/146851"&gt;@glenndoiron&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The default configuration provided in the MBDT toolbox targets the Evaluation boards delivered by NXP.&lt;/P&gt;
&lt;P&gt;Luckily, this default configuration could be easily adapted to generate code for your particular setup. In your case, you could change the s32k_clock_init.c file from the sources of our toolbox. This file is always copied when the code is generated from the toolbox sources. What you could do is to type the following command in MATLAB Command Window:&amp;nbsp;cd(fullfile(mbd_find_s32k_root, 'mbdtbx_s32k14x\src\c_library'))&lt;/P&gt;
&lt;P&gt;Here, you could&amp;nbsp; modify the extRef clock, EREFS value from&amp;nbsp;SCG_SOSC_REF_OSC &amp;nbsp;into&amp;nbsp;SCG_SOSC_REF_EXT&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariuslucianand_0-1659349205853.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188651i36B3CB45C3BA833A/image-size/large?v=v2&amp;amp;px=999" role="button" title="mariuslucianand_0-1659349205853.png" alt="mariuslucianand_0-1659349205853.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Marius&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 10:21:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-toolbox-does-not-allow-using-an-external-oscillator-on-SOSC/m-p/1498752#M7573</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2022-08-01T10:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: MBD toolbox does not allow using an external oscillator on SOSC(critical/potential hardware fail</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-toolbox-does-not-allow-using-an-external-oscillator-on-SOSC/m-p/1498838#M7575</link>
      <description>&lt;P&gt;This is great information.&lt;/P&gt;&lt;P&gt;A bit more digging thru the datasheet reveals the source of my confusion; the SOSC module is referred to as the system oscillator in some sections, while in others it is referred to as the external reference clock.&lt;/P&gt;&lt;P&gt;Additionally in chapter 28, under the description of the EREFS bit, it says&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;External Reference Select&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Selects the source for the &lt;EM&gt;external reference clock&lt;/EM&gt;. This bit selects which clock is output from the System&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;OSC (SOSC) into the SCG, thus either the crystal oscillator or from an external clock input&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;0 External reference clock selected&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;1 Internal crystal oscillator of OSC selected.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The data sheet should probably be amended here (where italicized), and in the other parts which call it the "external reference clock" instead of the system oscillator (such as in the watchdog timer module section), to instead refer to it as the "System Oscillator Clock".&amp;nbsp; This bit is switching between an external clock signal at valid digital input levels (external reference) or a buffer which is sampling the output of the internal amplifier (used for driving a crystal).&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 13:09:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MBD-toolbox-does-not-allow-using-an-external-oscillator-on-SOSC/m-p/1498838#M7575</guid>
      <dc:creator>glenndoiron</dc:creator>
      <dc:date>2022-08-01T13:09:47Z</dc:date>
    </item>
  </channel>
</rss>

