You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by marko kiiskila <ma...@runtime.io> on 2017/03/30 16:28:07 UTC

Re: [apache/incubator-mynewt-core] PIC32 port (#218)

Hi Julian,

I’m sending this response to dev-list, as I think this discussion is good
for all :)

The way we’ve done this for other MCU SDKs is in one of the 2 ways:

a) create a package out of the SDK itself; this we did for nordic’s SDK,
https://github.com/runtimeco/mynewt_nordic/tree/master/hw/mcu/nordic_sdk <https://github.com/runtimeco/mynewt_nordic/tree/master/hw/mcu/nordic_sdk>
Nordic’s SDK is not part of the core repository, because their license terms
prevent us from including it. It is free enough for us to host it somewhere
else though.
And for NXP,
https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/nxp/src/ext/sdk-2.0-frdm-k64f_b160321 <https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/nxp/src/ext/sdk-2.0-frdm-k64f_b160321>
Their SDK license allowed us to include it in core.

b) include the SDK under hw/mcu/<cpuname>; this we did for STM32Fxxx,
https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/stm/stm32f4xx <https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/stm/stm32f4xx>
https://github.com/apache/incubator-mynewt-core/tree/develop/hw/mcu/stm/stm32f7xx <https://github.com/apache/incubator-mynewt-core/tree/develop/hw/mcu/stm/stm32f7xx>
which are part of core repo; again, good license.
And for Atmel SAMD21
https://github.com/runtimeco/mynewt_arduino_zero/tree/master/hw/mcu/atmel/samd21xx <https://github.com/runtimeco/mynewt_arduino_zero/tree/master/hw/mcu/atmel/samd21xx>
This too had to be placed outside core repository, due to more restrictive
license.

We’ve packaged MCU SDKs as packages so that we have control over
which version we compile against.

I think we should take a look at microchip license, and see if the SDK part of it
is extractable. If it is, then good. If not, then we must consider alternatives.

Thanks for doing this work, BTW.
—
M

> On Mar 30, 2017, at 5:19 AM, IMGJulian <no...@github.com> wrote:
> 
> @IMGJulian commented on this pull request.
> 
> In compiler/xc32/compiler.yml <https://github.com/apache/incubator-mynewt-core/pull/218#discussion_r108910583>:
> 
> > +# Unless required by applicable law or agreed to in writing,
> +# software distributed under the License is distributed on an
> +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> +# KIND, either express or implied.  See the License for the
> +# specific language governing permissions and limitations
> +# under the License.
> +#
> +
> +compiler.path.cc: "xc32-gcc"
> +compiler.path.as: "xc32-gcc"
> +compiler.path.archive: "xc32-ar"
> +compiler.path.objdump: "xc32-objdump"
> +compiler.path.objsize: "xc32-size"
> +compiler.path.objcopy: "xc32-objcopy"
> +
> +compiler.flags.base: -I/opt/microchip/xc32/v1.42/pic32mx/include -std=gnu11
> The hardcoded path was something I meant to ask about and it slipped my mind... I am not sure how to improve this under your newt tool. It would be nice if the user could specify a path in a more intuitive manner should there be a non-default install of XC32 or a version change. Any suggestions would be appreciated.
> 
> Currently our GCC implementation does not fully support the PIC External interrupt controller. The choice was made to use Microchip's XC32 in order to make use of multiple interrupt vectors (making it significantly easier for the user to add their own ISRs).
> 
> As for the similarities between the MX and MZ kernel ports, I belive they are currently the same. The MZ port still has some functionality to drop in so to minimise the changes that would need to be made in the future I made 2 copies, Thinking about it now, it might be better to use preprocessor options to conditionally compile from one file. Again, any suggestions would be appreciated.
> 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub <https://github.com/apache/incubator-mynewt-core/pull/218#discussion_r108910583>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACJt9h5oiA34z5DDmSgAe7UdzOIhSBuJks5rq520gaJpZM4MuIwt>.
> 


Re: [apache/incubator-mynewt-core] PIC32 port (#218)

Posted by Sterling Hughes <st...@gmail.com>.
Hi Julian,

On 31 Mar 2017, at 1:54, Julian Ingram wrote:

> Hi Marko,
>
> The Microchip license:
>
> /*-------------------------------------------------------------------------
>  *
>  * Copyright (c) 2014, Microchip Technology Inc. and its subsidiaries 
> ("Microchip")
>  * All rights reserved.
>  * This software is developed by Microchip Technology Inc. and its
>  * subsidiaries ("Microchip").
>  *
>  * Redistribution and use in source and binary forms, with or without
>  * modification, are permitted provided that the following conditions 
> are
>  * met:
>  *
>  * 1.      Redistributions of source code must retain the above 
> copyright
>  *         notice, this list of conditions and the following 
> disclaimer.
>  * 2.      Redistributions in binary form must reproduce the above
>  *         copyright notice, this list of conditions and the following
>  *         disclaimer in the documentation and/or other materials 
> provided
>  *         with the distribution.
>  * 3.      Microchip's name may not be used to endorse or promote 
> products
>  *         derived from this software without specific prior written
>  *         permission.
>  *
>  * THIS SOFTWARE IS PROVIDED BY MICROCHIP "AS IS" AND ANY EXPRESS OR 
> IMPLIED
>  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
> OF
>  * MERCHANTABILITY AND FITNESS FOR PURPOSE ARE DISCLAIMED. IN NO EVENT
>  * SHALL MICROCHIP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
> SPECIAL,
>  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO
>  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR 
> PROFITS;
>  * OR BUSINESS INTERRUPTION) HOWSOEVER CAUSED AND ON ANY THEORY OF 
> LIABILITY,
>  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
> NEGLIGENCE OR
>  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 
> IF
>  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>  *
>  *-------------------------------------------------------------------------*/
>

This is BSD, this is perfectly OK.

> The only other thing is the Microchip SDK is quite large (several GB), 
> this being the case it might be worth making it a separate package. We 
> would likely be dooming our users to having 2 copies of the SDK on 
> their drives as the SDK is installed with the compiler when you 
> download it so it might be worth picking out just the bits we need.
>

+1.  I think we should take what\u2019s relevant to implement our HAL and 
include it in repo, and then ideally distribute the rest of the SDK as 
an external package.  If imgtech has a GitHub account they could host 
on, that would be ideal - otherwise we could also host as Runtime.

Best,

Sterling

RE: [apache/incubator-mynewt-core] PIC32 port (#218)

Posted by Julian Ingram <Ju...@imgtec.com>.
Hi Marko,

The Microchip license:

/*-------------------------------------------------------------------------
 *
 * Copyright (c) 2014, Microchip Technology Inc. and its subsidiaries ("Microchip")
 * All rights reserved.
 * This software is developed by Microchip Technology Inc. and its
 * subsidiaries ("Microchip").
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * 1.      Redistributions of source code must retain the above copyright
 *         notice, this list of conditions and the following disclaimer.
 * 2.      Redistributions in binary form must reproduce the above
 *         copyright notice, this list of conditions and the following
 *         disclaimer in the documentation and/or other materials provided
 *         with the distribution.
 * 3.      Microchip's name may not be used to endorse or promote products
 *         derived from this software without specific prior written
 *         permission.
 *
 * THIS SOFTWARE IS PROVIDED BY MICROCHIP "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR PURPOSE ARE DISCLAIMED. IN NO EVENT
 * SHALL MICROCHIP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWSOEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *-------------------------------------------------------------------------*/

The only other thing is the Microchip SDK is quite large (several GB), this being the case it might be worth making it a separate package. We would likely be dooming our users to having 2 copies of the SDK on their drives as the SDK is installed with the compiler when you download it so it might be worth picking out just the bits we need.

Thanks,

Julian

-----Original Message-----
From: marko kiiskila [mailto:marko@runtime.io] 
Sent: 30 March 2017 17:28
To: dev
Cc: apache/incubator-mynewt-core; Subscribed
Subject: Re: [apache/incubator-mynewt-core] PIC32 port (#218)

Hi Julian,

I’m sending this response to dev-list, as I think this discussion is good for all :)

The way we’ve done this for other MCU SDKs is in one of the 2 ways:

a) create a package out of the SDK itself; this we did for nordic’s SDK, https://github.com/runtimeco/mynewt_nordic/tree/master/hw/mcu/nordic_sdk <https://github.com/runtimeco/mynewt_nordic/tree/

b) include the SDK under hw/mcu/<cpuname>; this we did for STM32Fxxx, https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/stm/stm32f4xx <https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/stm/stm32f4xx>
https://github.com/apache/incubator-mynewt-core/tree/develop/hw/mcu/stm/stm32f7xx <https://github.com/apache/incubator-mynewt-core/tree/develop/hw/mcu/stm/stm32f7xx>
which are part of core repo; again, good license.
And for Atmel SAMD21master/hw/mcu/nordic_sdk>
Nordic’s SDK is not part of the core repository, because their license terms prevent us from including it. It is free enough for us to host it somewhere else though.
And for NXP,
https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/nxp/src/ext/sdk-2.0-frdm-k64f_b160321 <https://github.com/apache/incubator-mynewt-core/tree/master/hw/mcu/nxp/src/ext/sdk-2.0-frdm-k64f_b160321>
Their SDK license allowed us to include it in core.
https://github.com/runtimeco/mynewt_arduino_zero/tree/master/hw/mcu/atmel/samd21xx <https://github.com/runtimeco/mynewt_arduino_zero/tree/master/hw/mcu/atmel/samd21xx>
This too had to be placed outside core repository, due to more restrictive license.

We’ve packaged MCU SDKs as packages so that we have control over which version we compile against.

I think we should take a look at microchip license, and see if the SDK part of it is extractable. If it is, then good. If not, then we must consider alternatives.

Thanks for doing this work, BTW.
—
M

> On Mar 30, 2017, at 5:19 AM, IMGJulian <no...@github.com> wrote:
> 
> @IMGJulian commented on this pull request.
> 
> In compiler/xc32/compiler.yml <https://github.com/apache/incubator-mynewt-core/pull/218#discussion_r108910583>:
> 
> > +# Unless required by applicable law or agreed to in writing,
> +# software distributed under the License is distributed on an # "AS 
> +IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either 
> +express or implied.  See the License for the # specific language 
> +governing permissions and limitations # under the License.
> +#
> +
> +compiler.path.cc: "xc32-gcc"
> +compiler.path.as: "xc32-gcc"
> +compiler.path.archive: "xc32-ar"
> +compiler.path.objdump: "xc32-objdump"
> +compiler.path.objsize: "xc32-size"
> +compiler.path.objcopy: "xc32-objcopy"
> +
> +compiler.flags.base: -I/opt/microchip/xc32/v1.42/pic32mx/include 
> +-std=gnu11
> The hardcoded path was something I meant to ask about and it slipped my mind... I am not sure how to improve this under your newt tool. It would be nice if the user could specify a path in a more intuitive manner should there be a non-default install of XC32 or a version change. Any suggestions would be appreciated.
> 
> Currently our GCC implementation does not fully support the PIC External interrupt controller. The choice was made to use Microchip's XC32 in order to make use of multiple interrupt vectors (making it significantly easier for the user to add their own ISRs).
> 
> As for the similarities between the MX and MZ kernel ports, I belive they are currently the same. The MZ port still has some functionality to drop in so to minimise the changes that would need to be made in the future I made 2 copies, Thinking about it now, it might be better to use preprocessor options to conditionally compile from one file. Again, any suggestions would be appreciated.
> 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub <https://github.com/apache/incubator-mynewt-core/pull/218#discussion_r108910583>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACJt9h5oiA34z5DDmSgAe7UdzOIhSBuJks5rq520gaJpZM4MuIwt>.
>