
from platformio.managers.platform import PlatformBase


class Ststm32Platform(PlatformBase):

    def configure_default_packages(self, variables, targets):
        board = variables.get("board")
        if "mbed" in variables.get("pioframework",
                                   []) or board == "mxchip_az3166":
            self.packages['toolchain-gccarmnoneeabi'][
                'version'] = ">=1.60301.0"

        if board == "mxchip_az3166":
            self.frameworks['arduino'][
                'script'] = "builder/frameworks/arduino/mxchip.py"

            self.packages['tool-openocd']['type'] = "uploader"

        return PlatformBase.configure_default_packages(self, variables,
                                                       targets)


from platformio.managers.platform import PlatformBase


class Ststm32Platform(PlatformBase):

    def configure_default_packages(self, variables, targets):
        board = variables.get("board")
        if "mbed" in variables.get("pioframework",
                                   []) or board == "mxchip_az3166":
            self.packages['toolchain-gccarmnoneeabi'][
                'version'] = ">=1.60301.0"

        if board == "mxchip_az3166":
            self.frameworks['arduino'][
                'package'] = "framework-arduinostm32mxchip"
            self.frameworks['arduino'][
                'script'] = "builder/frameworks/arduino/mxchip.py"

            self.packages['tool-openocd']['type'] = "uploader"

        return PlatformBase.configure_default_packages(self, variables,
                                                       targets)

Use appropriate package for mxchip_az3166
Use appropriate package for mxchip_az3166

  
  from platformio.managers.platform import PlatformBase
  
  
  class Ststm32Platform(PlatformBase):
  
      def configure_default_packages(self, variables, targets):
          board = variables.get("board")
          if "mbed" in variables.get("pioframework",
                                     []) or board == "mxchip_az3166":
              self.packages['toolchain-gccarmnoneeabi'][
                  'version'] = ">=1.60301.0"
  
          if board == "mxchip_az3166":
              self.frameworks['arduino'][
+                 'package'] = "framework-arduinostm32mxchip"
+             self.frameworks['arduino'][
                  'script'] = "builder/frameworks/arduino/mxchip.py"
  
              self.packages['tool-openocd']['type'] = "uploader"
  
          return PlatformBase.configure_default_packages(self, variables,
                                                         targets)
  
Use appropriate package for mxchip_az3166
## Code Before:

from platformio.managers.platform import PlatformBase


class Ststm32Platform(PlatformBase):

    def configure_default_packages(self, variables, targets):
        board = variables.get("board")
        if "mbed" in variables.get("pioframework",
                                   []) or board == "mxchip_az3166":
            self.packages['toolchain-gccarmnoneeabi'][
                'version'] = ">=1.60301.0"

        if board == "mxchip_az3166":
            self.frameworks['arduino'][
                'script'] = "builder/frameworks/arduino/mxchip.py"

            self.packages['tool-openocd']['type'] = "uploader"

        return PlatformBase.configure_default_packages(self, variables,
                                                       targets)

## Instruction:
Use appropriate package for mxchip_az3166
## Code After:

from platformio.managers.platform import PlatformBase


class Ststm32Platform(PlatformBase):

    def configure_default_packages(self, variables, targets):
        board = variables.get("board")
        if "mbed" in variables.get("pioframework",
                                   []) or board == "mxchip_az3166":
            self.packages['toolchain-gccarmnoneeabi'][
                'version'] = ">=1.60301.0"

        if board == "mxchip_az3166":
            self.frameworks['arduino'][
                'package'] = "framework-arduinostm32mxchip"
            self.frameworks['arduino'][
                'script'] = "builder/frameworks/arduino/mxchip.py"

            self.packages['tool-openocd']['type'] = "uploader"

        return PlatformBase.configure_default_packages(self, variables,
                                                       targets)
