Skip to content

Add ARM_MUSCA_A1 as a new target platform #8845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions targets/TARGET_ARM_SSG/TARGET_MUSCA_A1/PeripheralNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2018 Arm Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/

#ifndef MBED_PERIPHERALNAMES_H
#define MBED_PERIPHERALNAMES_H

#include "cmsis.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
PORTNUM_0 = 0
} PortName;

typedef enum {
UART_0 = 0,
UART_1
} UARTName;

#define STDIO_UART_TX UART1_TX
#define STDIO_UART_RX UART1_RX
#define STDIO_UART UART_1

#define USBTX STDIO_UART_TX
#define USBRX STDIO_UART_RX

#ifdef __cplusplus
}
#endif

#endif
112 changes: 112 additions & 0 deletions targets/TARGET_ARM_SSG/TARGET_MUSCA_A1/PinNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2018 Arm Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/

#ifndef MBED_PINNAMES_H
#define MBED_PINNAMES_H

#include "cmsis.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
PIN_INPUT,
PIN_OUTPUT
} PinDirection;

typedef enum {
PA0 = 0,
PA1 = 1,
PA2 = 2,
PA3 = 3,
PA4 = 4,
PA5 = 5,
PA6 = 6,
PA7 = 7,
PA8 = 8,
PA9 = 9,
PA10 = 10,
PA11 = 11,
PA12 = 12,
PA13 = 13,
PA14 = 14,
PA15 = 15,
PA16 = 16,
PA17 = 17,
PA18 = 18,
PA19 = 19,
PA20 = 20,
PA21 = 21,
PA22 = 22,
PA23 = 23,
PA24 = 24,
PA25 = 25,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborkertesz : Can you add the pins brought out on the Arduino headers as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. __init.py: This is added by purpose in order to import the musca post build Python script as a module. If it's not really needed and I'm wrong, I can remove this of course.
  2. PeripheralPins.c: I think the required feature is implemented
    in pinmap.c.
  3. Can't attach the txt files here, it says: "Something went really wrong, and we can't process that file." Any other suggestion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. There are 2 init.py scripts -> tools/targets/ARM_MUSCA_A1/init.py (empty) and tools/targets/init.py in the PR ..
  2. Will check.
  3. ZIP it up and you can upload the ZIP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yes and we're talking about tools/targets/ARM_MUSCA_A1/init.py now. That's the one I created in order to import tools.targets.ARM_MUSCA_A1.ARM_MUSCA_A1_TFM in the existing tools/targets/init.py
  2. ZIP also doesn't work.
    ARMC6: http://p.arm.com/?130
    GCC: http://p.arm.com/?--g

/* Arduino Connector Namings */
D0 = PA0,
D1 = PA1,
D2 = PA2,
D3 = PA3,
D4 = PA4,
D5 = PA5,
D6 = PA6,
D7 = PA7,
D8 = PA8,
D9 = PA9,
D10 = PA10,
D11 = PA11,
D12 = PA12,
D13 = PA13,
D14 = PA14,
D15 = PA15,

/* UART pins */
UART0_RX = PA0, /* Alternate Function - 1 */
UART0_TX = PA1, /* Alternate Function - 1 */
UART1_RX = PA16,
UART1_TX = PA17,

LED1 = PA2,
LED2 = PA3,
LED3 = PA4,

/* Not connected */
NC = -1u,
} PinName;

typedef enum {
PRIMARY_FUNC = 0,
ALTERNATE_FUNC_1 = 1,
ALTERNATE_FUNC_2 = 2,
ALTERNATE_FUNC_3 = 3
} PinFunction;

typedef enum {
PullNone = 0,
PullUp,
PullDown,
PullDefault = PullNone
} PinMode;

#ifdef __cplusplus
}
#endif

#endif

Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/

#ifndef __AUDIT_WRAPPERS_H__
#define __AUDIT_WRAPPERS_H__

#ifdef __cplusplus
extern "C" {
#endif

/*!
* \struct audit_core_retrieve_input
*
* \brief Input structure for the audit_core_retrieve_record_wrapper function
*
*/
struct audit_core_retrieve_input {
const uint32_t record_index; /*!< Index of the record to retrieve */
const uint32_t buffer_size; /*!< Size in bytes of the provided buffer */
const uint8_t *token; /*!< Must be set to NULL. Token used as a
* challenge for encryption, to protect
* against rollback attacks
*/
const uint32_t token_size; /*!< Must be set to 0. Size in bytes of the
* token used as challenge
*/
};

/*!
* \struct audit_core_retrieve_output
*
* \brief Output structure for the audit_core_retrieve_record_wrapper function
*
*/
struct audit_core_retrieve_output {
uint8_t *buffer; /*!< Buffer used to store the retrieved record */
uint32_t *record_size; /*!< Size in bytes of the retrieved record */
};

/*!
* \brief This function is a TF-M compatible wrapper for the
* \ref audit_core_retrieve_record implemented in the Audit log
* core functions
*
* \param[in] input_s Pointer to the structure containing input parameters
* associated with \ref psa_audit_retrieve_record
* \param[out] output_s Pointer to the structure containing output parameters
* associated with \ref psa_audit_retrieve_record
*
*/
enum psa_audit_err audit_core_retrieve_record_wrapper(
const struct audit_core_retrieve_input *input_s,
struct audit_core_retrieve_output *output_s);

#ifdef __cplusplus
}
#endif

#endif /* __AUDIT_WRAPPERS_H__ */
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/

#ifndef __CRYPTO_PSA_WRAPPERS_H__
#define __CRYPTO_PSA_WRAPPERS_H__

#ifdef __cplusplus
extern "C" {
#endif

/*!
* \struct psa_cipher_update_input
*
* \brief Input structure for the tfm_crypto_cipher_update_wrapper function
*
*/
struct psa_cipher_update_input {
const uint8_t *input; /*!< Input data to the cipher */
size_t input_length; /*!< Size of the input data */
};

/*!
* \struct psa_cipher_update_output
*
* \brief Output structure for the tfm_crypto_cipher_update_wrapper function
*
*/
struct psa_cipher_update_output {
unsigned char *output; /*!< Buffer to hold the output data from the cipher*/
size_t output_size; /*!< Size of the output buffer */
size_t *output_length; /*!< Size of the output data from the cipher */
};

/*!
* \brief This function is a TF-M compatible wrapper for the
* \ref tfm_crypto_cipher_update implemented in the Crypto service
*
* \param[in] input_s Pointer to the structure containing input parameters
* associated with \ref psa_cipher_update_input
* \param[out] output_s Pointer to the structure containing output parameters
* associated with \ref psa_cipher_update_output
*
*/
enum tfm_crypto_err_t tfm_crypto_cipher_update_wrapper(
psa_cipher_operation_t *operation,
struct psa_cipher_update_input *input_s,
struct psa_cipher_update_output *output_s);

#ifdef __cplusplus
}
#endif

#endif /* __CRYPTO_PSA_WRAPPERS_H__ */
Loading