Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 713
» Latest member: mro
» Forum threads: 768
» Forum posts: 5,286

Full Statistics

Latest Threads
Wizard for new controller...
Forum: STmicro
Last Post: Stefan
Yesterday, 10:45 AM
» Replies: 0
» Views: 43
Support STM32F7xxx series...
Forum: ARM gdb
Last Post: Argo4x4
02-20-2017, 10:06 PM
» Replies: 7
» Views: 1,714
Use first flash sectors f...
Forum: ArmGCC - EmBlocks
Last Post: OliviliK
02-18-2017, 06:36 PM
» Replies: 3
» Views: 147
Lazy Editor
Forum: EmBitz IDE
Last Post: armloocee
02-18-2017, 02:08 PM
» Replies: 0
» Views: 77
Add condition in .ld link...
Forum: ArmGCC - EmBlocks
Last Post: EmBitz
02-17-2017, 09:54 AM
» Replies: 1
» Views: 85
Can not download SVD file...
Forum: SVD (System view) files
Last Post: EmBitz
02-17-2017, 09:49 AM
» Replies: 3
» Views: 77
Suggestions future releas...
Forum: EmBitz IDE
Last Post: Argo4x4
02-16-2017, 03:04 PM
» Replies: 126
» Views: 37,514
ST-Link V2-1 and Windows ...
Forum: ARM gdb
Last Post: omc8db
02-16-2017, 01:51 AM
» Replies: 3
» Views: 170
Noob startup troubles usi...
Forum: General
Last Post: OliviliK
02-12-2017, 06:36 PM
» Replies: 4
» Views: 170
CubeMX and the HAL librar...
Forum: EmBitz IDE
Last Post: mdctech
02-12-2017, 10:49 AM
» Replies: 4
» Views: 268

 
  Wizard for new controllers
Posted by: Stefan - Yesterday, 10:45 AM - Forum: STmicro - No Replies

Hello everybody,

right now I'm looking for new IDE for STM32F4 Projects and EmBitz seems good.

But in the Project Wizard I'm missing some controller types, i.e. STM32F410 or F469

I already found out that the list can easily be extended via devices.xml but I wonder where to get startupfile?

Is there a generic way i.e. use STMs Cube MX, generate files and use them?


thanks

Stefan

Print this item

  Lazy Editor
Posted by: armloocee - 02-18-2017, 02:08 PM - Forum: EmBitz IDE - No Replies

It's nice to have such a nice editor, but sometimes it's getting somewhat lazy ...

Please see the attachment.



Attached Files Thumbnail(s)
   
Print this item

  Use first flash sectors for user data?
Posted by: mri - 02-17-2017, 11:22 AM - Forum: ArmGCC - EmBlocks - Replies (3)

I'm using a STM32F411VET6, which have 8 flash sectors. The first 4 sectors are 16 kbyte each.
I'd like to use two of these sectors for user parameters, preferably so that when downloading the application when debugging using the STLINK/V2 dongle, those user parameters are not overwritten.

I've done some initial attempts and modified the linker script so that ROM start from sector 2, like this:

/* Memory Spaces Definitions */
MEMORY
{
    ROM  (rx) : ORIGIN = 0x08008000, LENGTH = 480K
    RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
}

I can see in map-file that code is now placed starting from sector 2.

I also modify STLINK/V2 debug interface setting in EmBitz, "Vector table start" to 0x08008000,
and in system_stm32f4xxx.c I set vector table offset to:

#define VECT_TAB_OFFSET  0x8000

But, it doesn't work. When i start the debugger, it downloads the program, but I am unable to start it.

What am I missing?
Is it possible at all?

I'm using EmBitz 1.11

Print this item

  Add condition in .ld linker file
Posted by: martincactus - 02-16-2017, 09:13 PM - Forum: ArmGCC - EmBlocks - Replies (1)

Hi,

I want to add conditions in my .ld file if I am in DEBUG mode.  Is there a way similar to C how to acheive this? 

Thank you

Print this item

  Can not download SVD files
Posted by: soft_raider - 02-16-2017, 01:26 PM - Forum: SVD (System view) files - Replies (3)

Hi,

How I can add SVD file to project?
Or to use svd "feature" I should pay for membership?

Thanks.
WBR,
Andrew

Print this item

Bug Noob startup troubles using tutorial
Posted by: obiwanjacobi - 02-11-2017, 12:41 PM - Forum: General - Replies (4)

Hi,

First post, just starting with Embitz and a cheap STM32F103C8 board doing this tutorial:
https://github.com/OliviliK/STM32F103/wi...HelloWorld

What I have working (on Windows 8.1):
Installed the ST-Link v2 USB driver
Installed Embitz 1.11
Attached ST-Link (clone) and board - with extra reset line. Boot pins at 0.
Board powers up (blinks led - probably a default test prog).
Created new project and code compiles (printf)
Can start debug session (F8)

When I run (F5), I see in the debugger output pane:


Quote:Building to ensure sources are up-to-date
Build succeeded
Selecting target: 
Debug
Adding file: bin\Debug\FirstArmTest.elf
Adding source dir: C:\Users\marc\Documents\Projects\Personal\ARM\FirstArmTest\FirstArmTest\
Adding source dir: C:\Users\marc\Documents\Projects\Personal\ARM\FirstArmTest\FirstArmTest\
Starting debugger: 
done
Setting breakpoints
EmBitz embedded firmware debugger for arm-none-eabi (Sep 30 2016/14:16:49).
Based on (GDB)  7.8.2 - License GPLv3+ by Gerard Zagema.
This program comes with ABSOLUTELY NO WARRANTY; for details type "show war".
This is free software, and you are welcome to redistribute it
under certain conditions; type "show cop" for details.

Reading symbols from bin/Debug/FirstArmTest.elf...
done.
Source directories searched: C:/Users/marc/Documents/Projects/Personal/ARM/FirstArmTest/FirstArmTest;$cdir;$cwd
Remote debugging using localhost:4242
0x6722056c0x6722056c in ?? ()
Connected
Loading section .text, size 0x121c lma 0x8000000

Nothing else. No Hello World in the debugger-target pane...


This is what is on the debugger console window:
Quote:STLINK GDB Server (EmBitz Dec  8 2016 12:12:38)
Shutdown after disconnect is active.
Connect under reset is active.

Connected to STlink/V2 probe at 002:015
Chip ID is 00000410, Core ID is  1ba01477.
Target voltage: 3.29
Number of HW-breakpoints: 6
Listening at *:4242...
GDB connected.
Reset: system
Reset: system
Write memory: address 0xE000ED08 (Data = 0x8000000)

Not sure what to do next.
Any suggestions?

PS: When I stop the debugger it stops at line 268 of the startup_stm32f10x_md.s file; the I2C2_EV_IRQHandler...

Print this item

  CubeMX and the HAL library
Posted by: leddel - 02-10-2017, 11:48 AM - Forum: EmBitz IDE - Replies (4)

Hello,

I have used Emblocks in the past multiple times with STmicroelectronics STM32. I was verry happy with it. Then after some time I got license for KEIL for work so used that for some years. Now I'm back with Emblocks (now EMbitz) but the ST has switched in the mean time to the HAL library and has build very nice tool called CubeMX. I think this is a very handy tool for quickly starting a project. Now I have seen multiple threads about this CubeMX but I'm not able to find a clear answer.

- Is there an easy way of importing CubeMX generated files?
- Once imported. If I change some setting in CubeMX, do I need to completely import the files again?
- If CubeMX not supported by EMbitz. Will it be in the future?

Thanks in advance!

Best regards,

LeddeL

Print this item

  How to avoid warning"always_inline function might not be inlinable"
Posted by: rgw5267 - 02-09-2017, 08:13 AM - Forum: ArmGCC - EmBlocks - Replies (2)

Platform:STM32F429, FreeRTOS v9.00
Compiler:ARM GCC Compiler(EmBitz - bare-metal)
EmBitz version: 1.11
FreeRTOS portable: FreeRTOS\Source\portable\GCC\ARM_CM4F

Now this system works well, but the compiler always shows "warning: always_inline function might not be inlinable [-Wattributes] ". 
How to avoid it.

Quote:..\..\src\hmi\HMI_Start.c|6|warning: implicit declaration of function 'CreateEVSE' [-Wimplicit-function-declaration]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\middlewares\mxml-2.10\mxml-file-fatfs.c|27|warning: "getc" redefined|
d:\program files (x86)\embitz\1.11\share\em_armgcc\arm-none-eabi\include\stdio.h|726|note: this is the location of the previous definition|
..\..\src\middlewares\mxml-2.10\mxml-file-fatfs.c|28|warning: "putc" redefined|
d:\program files (x86)\embitz\1.11\share\em_armgcc\arm-none-eabi\include\stdio.h|727|note: this is the location of the previous definition|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\middlewares\mxml-2.10\testmxml.c|565|warning: implicit declaration of function 'xprintf' [-Wimplicit-function-declaration]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|269|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|249|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|233|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|211|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\os\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h|172|warning: always_inline function might not be inlinable [-Wattributes]|
..\..\src\middlewares\userlib\src\userlib_queue.c|83|warning: implicit declaration of function 'xprintf' [-Wimplicit-function-declaration]|
bin\Debug\chargersdk.map|1|Program size (bytes):  362068|
||Data size    (bytes):    3704|
||BSS size     (bytes):   48432|
||             ----------------|
||Total size   (bytes):  414204   (R/W Memory: 52136)|
|||
||=== Build finished: 0 errors, 55 warnings (0 minutes, 58 seconds) ===|

portmacro.h code

Code:
/*
   FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
   All rights reserved

   VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.

   This file is part of the FreeRTOS distribution.

   FreeRTOS is free software; you can redistribute it and/or modify it under
   the terms of the GNU General Public License (version 2) as published by the
   Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.

   ***************************************************************************
   >>!   NOTE: The modification to the GPL is included to allow you to     !<<
   >>!   distribute a combined work that includes FreeRTOS without being   !<<
   >>!   obliged to provide the source code for proprietary components     !<<
   >>!   outside of the FreeRTOS kernel.                                   !<<
   ***************************************************************************

   FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   FOR A PARTICULAR PURPOSE.  Full license text is available on the following
   link: http://www.freertos.org/a00114.html

   ***************************************************************************
    *                                                                       *
    *    FreeRTOS provides completely free yet professionally developed,    *
    *    robust, strictly quality controlled, supported, and cross          *
    *    platform software that is more than just the market leader, it     *
    *    is the industry's de facto standard.                               *
    *                                                                       *
    *    Help yourself get started quickly while simultaneously helping     *
    *    to support the FreeRTOS project by purchasing a FreeRTOS           *
    *    tutorial book, reference manual, or both:                          *
    *    http://www.FreeRTOS.org/Documentation                              *
    *                                                                       *
   ***************************************************************************

   http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
   the FAQ page "My application does not run, what could be wrong?".  Have you
   defined configASSERT()?

   http://www.FreeRTOS.org/support - In return for receiving this top quality
   embedded software for free we request you assist our global community by
   participating in the support forum.

   http://www.FreeRTOS.org/training - Investing in training allows your team to
   be as productive as possible as early as possible.  Now you can receive
   FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
   Ltd, and the world's leading authority on the world's leading RTOS.

   http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
   including FreeRTOS+Trace - an indispensable productivity tool, a DOS
   compatible FAT file system, and our tiny thread aware UDP/IP stack.

   http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
   Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.

   http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
   Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
   licenses offer ticketed support, indemnification and commercial middleware.

   http://www.SafeRTOS.com - High Integrity Systems also provide a safety
   engineered and independently SIL3 certified version for use in safety and
   mission critical applications that require provable dependability.

   1 tab == 4 spaces!
*/


#ifndef PORTMACRO_H
#define PORTMACRO_H

#ifdef __cplusplus
extern "C" {
#endif

/*-----------------------------------------------------------
* Port specific definitions.
*
* The settings in this file configure FreeRTOS correctly for the
* given hardware and compiler.
*
* These settings should not be altered.
*-----------------------------------------------------------
*/

/* Type definitions. */
#define portCHAR        char
#define portFLOAT        float
#define portDOUBLE        double
#define portLONG        long
#define portSHORT        short
#define portSTACK_TYPE    uint32_t
#define portBASE_TYPE    long

typedef portSTACK_TYPE StackType_t;
typedef long BaseType_t;
typedef unsigned long UBaseType_t;

#if( configUSE_16_BIT_TICKS == 1 )
    typedef uint16_t TickType_t;
    #define portMAX_DELAY ( TickType_t ) 0xffff
#else
    typedef uint32_t TickType_t;
    #define portMAX_DELAY ( TickType_t ) 0xffffffffUL

    /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
    not need to be guarded with a critical section. */
    #define portTICK_TYPE_IS_ATOMIC 1
#endif
/*-----------------------------------------------------------*/

/* Architecture specifics. */
#define portSTACK_GROWTH            ( -1 )
#define portTICK_PERIOD_MS            ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
#define portBYTE_ALIGNMENT            8
/*-----------------------------------------------------------*/

/* Scheduler utilities. */
#define portYIELD()                                                             \
{                                                                                \
    /* Set a PendSV to request a context switch. */                                \
    portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;                                \
                                                                                \
    /* Barriers are normally not required but do ensure the code is completely    \
    within the specified behaviour for the architecture. */                        \
    __asm volatile( "dsb" );                                                    \
    __asm volatile( "isb" );                                                    \
}

#define portNVIC_INT_CTRL_REG        ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT        ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD()
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
/*-----------------------------------------------------------*/

/* Critical section management. */
extern void vPortEnterCritical( void );
extern void vPortExitCritical( void );
#define portSET_INTERRUPT_MASK_FROM_ISR()        ulPortRaiseBASEPRI()
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)    vPortSetBASEPRI(x)
#define portDISABLE_INTERRUPTS()                vPortRaiseBASEPRI()
#define portENABLE_INTERRUPTS()                    vPortSetBASEPRI(0)
#define portENTER_CRITICAL()                    vPortEnterCritical()
#define portEXIT_CRITICAL()                        vPortExitCritical()

/*-----------------------------------------------------------*/

/* Task function macros as described on the FreeRTOS.org WEB site.  These are
not necessary for to use this port.  They are defined so the common demo files
(which build with all the ports) will build. */
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
/*-----------------------------------------------------------*/

/* Tickless idle/low power functionality. */
#ifndef portSUPPRESS_TICKS_AND_SLEEP
    extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
    #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#endif
/*-----------------------------------------------------------*/

/* Architecture specific optimisations. */
#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
    #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#endif

#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1

    /* Generic helper function. */
    __attribute__( ( always_inline ) ) static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
    {
    uint8_t ucReturn;

        __asm volatile ( "clz %0, %1" : "=r" ( ucReturn ) : "r" ( ulBitmap ) );
        return ucReturn;
    }

    /* Check the configuration. */
    #if( configMAX_PRIORITIES > 32 )
        #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32.  It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
    #endif

    /* Store/clear the ready priorities in a bit map. */
    #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
    #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )

    /*-----------------------------------------------------------*/

    #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )

#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */

/*-----------------------------------------------------------*/

#ifdef configASSERT
    void vPortValidateInterruptPriority( void );
    #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()     vPortValidateInterruptPriority()
#endif

/* portNOP() is not required by this port. */
#define portNOP()

#define portINLINE    __inline

#ifndef portFORCE_INLINE
    #define portFORCE_INLINE inline __attribute__(( always_inline))
#endif

portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void )
{
uint32_t ulCurrentInterrupt;
BaseType_t xReturn;

    /* Obtain the number of the currently executing interrupt. */
    __asm volatile( "mrs %0, ipsr" : "=r"( ulCurrentInterrupt ) );

    if( ulCurrentInterrupt == 0 )
    {
        xReturn = pdFALSE;
    }
    else
    {
        xReturn = pdTRUE;
    }

    return xReturn;
}

/*-----------------------------------------------------------*/

portFORCE_INLINE static void vPortRaiseBASEPRI( void )
{
uint32_t ulNewBASEPRI;

    __asm volatile
    (
        "    mov %0, %1                                                \n"    \
        "    msr basepri, %0                                            \n" \
        "    isb                                                        \n" \
        "    dsb                                                        \n" \
        :"=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )
    );
}

/*-----------------------------------------------------------*/

portFORCE_INLINE static uint32_t ulPortRaiseBASEPRI( void )
{
uint32_t ulOriginalBASEPRI, ulNewBASEPRI;

    __asm volatile
    (
        "    mrs %0, basepri                                            \n" \
        "    mov %1, %2                                                \n"    \
        "    msr basepri, %1                                            \n" \
        "    isb                                                        \n" \
        "    dsb                                                        \n" \
        :"=r" (ulOriginalBASEPRI), "=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )
    );

    /* This return will not be reached but is necessary to prevent compiler
    warnings. */
    return ulOriginalBASEPRI;
}
/*-----------------------------------------------------------*/

portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue )
{
    __asm volatile
    (
        "    msr basepri, %0    " :: "r" ( ulNewMaskValue )
    );
}
/*-----------------------------------------------------------*/


#ifdef __cplusplus
}
#endif

#endif /* PORTMACRO_H */

Print this item

  Small misprint
Posted by: smitjs - 02-08-2017, 07:19 AM - Forum: SVD (System view) files - Replies (3)

On debugging STM32F103, I notice that on timer2,3,4, CCMR2 output bit 15 is shown as O2xCE instead of OCxCE.
A small matter, but can perhaps be corrected on next issue.
Wonderful debugger in any case.
Best Regards
Johan Smit

Print this item

  ST-Link V2-1 and Windows 10
Posted by: PDonchev - 02-04-2017, 07:55 PM - Forum: ARM gdb - Replies (3)

Hi,
Is there any working solution for using ST-Link V2-1 and EmBitz (under Windows 10)?
I'm using EmBitz with STM32F746G-DISC0 board. Already successfully ported the stock demonstration project
and I can download it with ST-Link Utility, but unfortunately debugging is not possible, because STLinkGDB can not connect with on-board ST-Link V2-1 device.
Only workaround for me was to break connection between on-board ST-Link and STM32F746 and use external ST-LinkV2. In this way I can debug successfully.

Print this item