Skip to content

Commit a7b9bc3

Browse files
committed
Merge branch 'devel'
2 parents 2a9a553 + c067cb7 commit a7b9bc3

File tree

24 files changed

+287
-39
lines changed

24 files changed

+287
-39
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ set(CMAKE_ERROR_FLAGS "-Wall -Wextra -Wpointer-arith -Wno-packed-bitfield-compat
4343

4444
# Build specific flags
4545
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ERROR_FLAGS}")
46-
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -DDEBUG")
46+
set(CMAKE_C_FLAGS_DEBUG "-Og -g3 -DDEBUG")
4747
set(CMAKE_C_FLAGS_RELEASE "-Os")
4848

4949
# When we break up long strings in CMake we get semicolon

boot/boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,5 @@ void update_firmware( void )
9797
}
9898
}
9999

100-
//erase_sector( UPGRADE_FLASH_START_SECTOR , UPGRADE_FLASH_END_SECTOR );
100+
erase_sector( UPGRADE_FLASH_START_SECTOR , UPGRADE_FLASH_END_SECTOR );
101101
}

linker/LPC1764_app.ld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ MEMORY
1313
__top_RamAHB16 = 0x2007c000 + 16K;
1414

1515
ENTRY(ResetISR)
16+
EXTERN(NMI_Handler)
17+
EXTERN(HardFault_Handler)
18+
EXTERN(MemManage_Handler)
19+
EXTERN(BusFault_Handler)
20+
EXTERN(UsageFault_Handler)
1621

1722
SECTIONS
1823
{
@@ -155,4 +160,6 @@ SECTIONS
155160

156161
PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
157162
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0);
163+
/* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */
164+
PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 ));
158165
}

linker/LPC1764_boot.ld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ MEMORY
1212
__top_RamAHB16 = 0x2007c000 + 16K;
1313

1414
ENTRY(ResetISR)
15+
EXTERN(NMI_Handler)
16+
EXTERN(HardFault_Handler)
17+
EXTERN(MemManage_Handler)
18+
EXTERN(BusFault_Handler)
19+
EXTERN(UsageFault_Handler)
1520

1621
SECTIONS
1722
{
@@ -147,4 +152,6 @@ SECTIONS
147152

148153
PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
149154
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0);
155+
/* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */
156+
PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 ));
150157
}

linker/LPC1769_app.ld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ MEMORY
1313
__top_RamAHB16 = 0x2007c000 + 32K;
1414

1515
ENTRY(ResetISR)
16+
EXTERN(NMI_Handler)
17+
EXTERN(HardFault_Handler)
18+
EXTERN(MemManage_Handler)
19+
EXTERN(BusFault_Handler)
20+
EXTERN(UsageFault_Handler)
1621

1722
SECTIONS
1823
{
@@ -155,4 +160,6 @@ SECTIONS
155160

156161
PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
157162
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0);
163+
/* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */
164+
PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 ));
158165
}

linker/LPC1769_boot.ld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ MEMORY
1212
__top_RamAHB16 = 0x2007c000 + 32K;
1313

1414
ENTRY(ResetISR)
15+
EXTERN(NMI_Handler)
16+
EXTERN(HardFault_Handler)
17+
EXTERN(MemManage_Handler)
18+
EXTERN(BusFault_Handler)
19+
EXTERN(UsageFault_Handler)
1520

1621
SECTIONS
1722
{
@@ -147,4 +152,6 @@ SECTIONS
147152

148153
PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
149154
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc16 - 0);
155+
/* Add 6 to the sum to compensate for the lacking of the less significant bit (thumb mode) */
156+
PROVIDE(_VectorChecksum = 0 - (_vStackTop + ResetISR + NMI_Handler + HardFault_Handler + MemManage_Handler + BusFault_Handler + UsageFault_Handler + 6 ));
150157
}

modules/i2c.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,9 @@
2525
#include "i2c.h"
2626
#include "i2c_mapping.h"
2727

28-
/**
29-
* @brief Number of I2C peripheral buses that are being controlled
30-
* @note This value is contabilized at compile time and may change from board to board. Check the board's i2c_mapping.c file for more info
31-
*
32-
* @see i2c_mapping.c
33-
*/
34-
#define I2C_MUX_COUNT (sizeof(i2c_mux) / sizeof(i2c_mux_state_t))
35-
36-
/**
37-
* @brief Number of I2C Chips that are being controlled
38-
* @note This value is contabilized at compile time and may change from board to board. Check the board's i2c_mapping.c file for more info
39-
*
40-
* @see i2c_mapping.c
41-
*/
42-
#define I2C_CHIP_MAP_COUNT (sizeof(i2c_chip_map)/sizeof(i2c_chip_mapping_t))
43-
4428
void i2c_init( void )
4529
{
46-
for ( uint8_t i = 0; i < sizeof(i2c_mux)/sizeof(i2c_mux_state_t); i++ ) {
30+
for ( uint8_t i = 0; i < I2C_MUX_CNT; i++ ) {
4731
i2c_mux[i].semaphore = xSemaphoreCreateBinary();
4832
vI2CConfig( i2c_mux[i].i2c_interface, SPEED_100KHZ );
4933
xSemaphoreGive( i2c_mux[i].semaphore );
@@ -101,7 +85,7 @@ bool i2c_take_by_busid( uint8_t bus_id, uint8_t *i2c_interface, TickType_t timeo
10185

10286
bool i2c_take_by_chipid( uint8_t chip_id, uint8_t *i2c_address, uint8_t *i2c_interface, uint32_t timeout )
10387
{
104-
if ( chip_id > I2C_CHIP_MAP_COUNT ) {
88+
if ( chip_id > I2C_BUS_CNT ) {
10589
return false;
10690
}
10791

modules/ipmb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,12 @@ void IPMB_RXTask ( void *pvParameters )
215215
/* Seq number checking is enough to match the messages */
216216
if ( current_msg_rx->buffer.seq == last_sent_req->buffer.seq ) {
217217
ipmb_notify_client ( current_msg_rx );
218+
} else {
219+
vPortFree(current_msg_rx);
218220
}
219221
/* If we received a response that doesn't match a previously sent request, just discard it */
222+
} else {
223+
vPortFree(current_msg_rx);
220224
}
221225

222226
}else {

modules/ipmi.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,18 @@ IPMI_HANDLER(ipmi_picmg_cmd_get_fru_control_capabilities, NETFN_GRPEXT, IPMI_PIC
324324
rsp->data_len = len;
325325
rsp->completion_code = IPMI_CC_OK;
326326
}
327+
328+
IPMI_HANDLER(ipmi_custom_cmd_get_free_heap, NETFN_CUSTOM, IPMI_CUSTOM_CMD_MMC_GET_FREE_HEAP, ipmi_msg *req, ipmi_msg *rsp)
329+
{
330+
uint8_t len = rsp->data_len = 0;
331+
332+
uint32_t free_heap = xPortGetFreeHeapSize();
333+
334+
rsp->data[len++] = free_heap & 0xFF;
335+
rsp->data[len++] = (free_heap >> 8) & 0xFF;
336+
rsp->data[len++] = (free_heap >> 16) & 0xFF;
337+
rsp->data[len++] = (free_heap >> 24) & 0xFF;
338+
339+
rsp->data_len = len;
340+
rsp->completion_code = IPMI_CC_OK;
341+
}

modules/ipmi.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,16 @@
461461
* @}
462462
*/
463463

464+
/**
465+
* @defgroup IPMI_CUSTOM_CMD IPMI Commands - Custom (0x32)
466+
* @ingroup IPMI_CMD
467+
* @{
468+
*/
469+
#define IPMI_CUSTOM_CMD_MMC_GET_FREE_HEAP 0x01
470+
/**
471+
* @}
472+
*/
473+
464474
#define IPMI_EVENT_MESSAGE_REV 0x04
465475

466476
/**

0 commit comments

Comments
 (0)