@@ -101,6 +101,74 @@ An example of :ref:`projectconf` with enabled ``rtos``
101101 build_flags = -D PIO_FRAMEWORK_MBED_RTOS_PRESENT
102102
103103
104+ Custom version of Mbed
105+ ^^^^^^^^^^^^^^^^^^^^^^
106+
107+ PlatformIO comes with only a few versions of Mbed supported out of the box. If you want
108+ to use another release of the Mbed framework, you can use the `plateform_packages ` config
109+ option. It should reference a directory containing `mbed-os <https://github.com/ARMmbed/mbed-os >`_
110+ plus the platformio `mbed builder code <https://github.com/platformio/builder-framework-mbed >`_
111+ and a `package.json ` file like:
112+
113+ .. code-block :: json
114+
115+ {
116+ "name" : " framework-mbed" ,
117+ "version" : " 6.61500.211003" ,
118+ "description" : " Arm Mbed OS is a platform operating system designed for the internet of things" ,
119+ "keywords" : [
120+ " framework" ,
121+ " os" ,
122+ " arm" ,
123+ " hal"
124+ ],
125+ "homepage" : " http://mbed.org" ,
126+ "repository" : {
127+ "type" : " git" ,
128+ "url" : " https://github.com/ARMmbed/mbed-os"
129+ }
130+ }
131+
132+ For example, to use the version 6.15 of mbed-os, you may:
133+
134+ .. code-block :: bash
135+
136+ ~ $ git clone https://github.com/ARMmbed/mbed-os framework-mbed
137+ ~ $ cd framework-mbed
138+ ~ /framework-mbed$ git checkout mbed-os-6.15.0
139+ ~ /framework-mbed$ git clone https://github.com/platformio/builder-framework-mbed# platformio
140+ ~ /framework-mbed$ cat > package.json << EOF
141+ {
142+ "name": "framework-mbed",
143+ "version": "6.61500.211003",
144+ "description": "Arm Mbed OS is a platform operating system designed for the internet of things",
145+ "keywords": [
146+ "framework",
147+ "os",
148+ "arm",
149+ "hal"
150+ ],
151+ "homepage": "http://mbed.org",
152+ "repository": {
153+ "type": "git",
154+ "url": "https://github.com/ARMmbed/mbed-os"
155+ }
156+ }
157+ EOF
158+
159+ Then one ca use the following ` platformio.ini` file:
160+
161+ .. code-block:: ini
162+
163+ [env:mproject]
164+ platform = ststm32
165+ framework = mbed
166+ platform_packages =
167+ framework-mbed @ file://framework-mbed
168+
169+ To build the project using mbed-os 6.15.0.
170+
171+
104172Build profiles
105173~~~~~~~~~~~~~~
106174
0 commit comments